AlternativePaymentsInc_AlternativePayments - Version 1.0.0

Version Notes

This module adds the wide range of different alternative payment methods.

Download this release

Release Info

Developer Alternative Payments Inc
Extension AlternativePaymentsInc_AlternativePayments
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (64) hide show
  1. app/code/community/AlternativePaymentsInc/AlternativePayments/Block/Form.php +35 -0
  2. app/code/community/AlternativePaymentsInc/AlternativePayments/Block/PaymentInfo.php +43 -0
  3. app/code/community/AlternativePaymentsInc/AlternativePayments/Block/Postback.php +34 -0
  4. app/code/community/AlternativePaymentsInc/AlternativePayments/Block/Redirect.php +34 -0
  5. app/code/community/AlternativePaymentsInc/AlternativePayments/Helper/Data.php +34 -0
  6. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Dbiban.php +36 -0
  7. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Dbsource.php +36 -0
  8. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Mysql4/Dbiban.php +34 -0
  9. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Mysql4/Dbiban/Collection.php +36 -0
  10. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Mysql4/Dbsource.php +35 -0
  11. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Mysql4/Dbsource/Collection.php +36 -0
  12. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Resource/Setup.php +31 -0
  13. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Session.php +33 -0
  14. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Standard.php +696 -0
  15. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/System/Config/Source/Allowtypeall.php +39 -0
  16. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/System/Config/Source/Payment/Alternativepaymenttype.php +45 -0
  17. app/code/community/AlternativePaymentsInc/AlternativePayments/Model/System/Config/Source/Testmode.php +39 -0
  18. app/code/community/AlternativePaymentsInc/AlternativePayments/controllers/IndexController.php +91 -0
  19. app/code/community/AlternativePaymentsInc/AlternativePayments/controllers/PaymentController.php +39 -0
  20. app/code/community/AlternativePaymentsInc/AlternativePayments/etc/config.xml +155 -0
  21. app/code/community/AlternativePaymentsInc/AlternativePayments/etc/system.xml +289 -0
  22. app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-install-0.1.0.php +51 -0
  23. app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.1.0-0.1.4.php +44 -0
  24. app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.1.4-0.2.0.php +74 -0
  25. app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.2.0-0.2.2.php +111 -0
  26. app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.2.2-0.2.3.php +74 -0
  27. app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.2.3-1.0.0.php +44 -0
  28. app/design/frontend/base/default/layout/alternativepayments.xml +42 -0
  29. app/design/frontend/base/default/template/alternativepayments/failure.phtml +40 -0
  30. app/design/frontend/base/default/template/alternativepayments/form.phtml +153 -0
  31. app/design/frontend/base/default/template/alternativepayments/form/ach.phtml +184 -0
  32. app/design/frontend/base/default/template/alternativepayments/form/barpay.phtml +28 -0
  33. app/design/frontend/base/default/template/alternativepayments/form/brazilpay.phtml +49 -0
  34. app/design/frontend/base/default/template/alternativepayments/form/chinadebit.phtml +28 -0
  35. app/design/frontend/base/default/template/alternativepayments/form/creditcard.phtml +130 -0
  36. app/design/frontend/base/default/template/alternativepayments/form/directpay.phtml +30 -0
  37. app/design/frontend/base/default/template/alternativepayments/form/directpaymax.phtml +73 -0
  38. app/design/frontend/base/default/template/alternativepayments/form/eps.phtml +28 -0
  39. app/design/frontend/base/default/template/alternativepayments/form/eurodebit.phtml +64 -0
  40. app/design/frontend/base/default/template/alternativepayments/form/giropay.phtml +57 -0
  41. app/design/frontend/base/default/template/alternativepayments/form/ideal.phtml +48 -0
  42. app/design/frontend/base/default/template/alternativepayments/form/paysafe.phtml +28 -0
  43. app/design/frontend/base/default/template/alternativepayments/form/poli.phtml +28 -0
  44. app/design/frontend/base/default/template/alternativepayments/form/przelewy.phtml +28 -0
  45. app/design/frontend/base/default/template/alternativepayments/form/qiwi.phtml +28 -0
  46. app/design/frontend/base/default/template/alternativepayments/form/sepa.phtml +810 -0
  47. app/design/frontend/base/default/template/alternativepayments/form/teleingreso.phtml +27 -0
  48. app/design/frontend/base/default/template/alternativepayments/form/yellowpay.phtml +30 -0
  49. app/design/frontend/base/default/template/alternativepayments/isapprove.phtml +42 -0
  50. app/design/frontend/base/default/template/alternativepayments/postback.phtml +130 -0
  51. app/design/frontend/base/default/template/alternativepayments/redirect.phtml +125 -0
  52. app/design/frontend/base/default/template/alternativepayments/response.phtml +44 -0
  53. app/design/frontend/base/default/template/alternativepayments/success.phtml +36 -0
  54. app/etc/modules/AlternativePaymentsInc_AlternativePayments.xml +9 -0
  55. app/locale/en_US/AlternativePaymentsInc_AlternativePayments.csv +76 -0
  56. package.xml +35 -0
  57. skin/frontend/base/default/alternativepayments/css/styles.css +59 -0
  58. skin/frontend/base/default/alternativepayments/images/cvv22.gif +0 -0
  59. skin/frontend/base/default/alternativepayments/images/information.png +0 -0
  60. skin/frontend/base/default/alternativepayments/images/phoneverf1.jpg +0 -0
  61. skin/frontend/base/default/alternativepayments/images/phoneverf2.jpg +0 -0
  62. skin/frontend/base/default/alternativepayments/images/phoneverf3.jpg +0 -0
  63. skin/frontend/base/default/alternativepayments/images/phoneverf4.jpg +0 -0
  64. skin/frontend/base/default/alternativepayments/images/qm.gif +0 -0
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Block_Form extends Mage_Payment_Block_Form
28
+ {
29
+ protected function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->setTemplate('alternativepayments/form.phtml');
33
+
34
+ }
35
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_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->getAlternativepaymentsTypeName()
40
+ ));
41
+ return $transport;
42
+ }
43
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Block_Postback extends Mage_Payment_Block_Form
28
+ {
29
+ protected function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->setTemplate('alternativepayments/postback.phtml');
33
+ }
34
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Block_Redirect extends Mage_Payment_Block_Form
28
+ {
29
+ protected function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->setTemplate('alternativepayments/redirect.phtml');
33
+ }
34
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/Helper/Data.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
+ */
22
+
23
+ /**
24
+ * Web service AlternativePayments helper
25
+ *
26
+ * @package AlternativePaymentsInc_AlternativePayments
27
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ class AlternativePaymentsInc_AlternativePayments_Helper_Data extends Mage_Core_Helper_Abstract
32
+ {
33
+
34
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_Dbiban extends Mage_Core_Model_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('alternativepayments/dbiban');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_Dbsource extends Mage_Core_Model_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('alternativepayments/dbsource');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_Mysql4_Dbiban extends Mage_Core_Model_Mysql4_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+
32
+ $this->_init('alternativepayments/dbiban', 'country_id');
33
+ }
34
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_Mysql4_Dbiban_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('alternativepayments/dbiban');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
24
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ class AlternativePaymentsInc_AlternativePayments_Model_Mysql4_Dbsource extends Mage_Core_Model_Mysql4_Abstract
29
+ {
30
+ public function _construct()
31
+ {
32
+
33
+ $this->_init('alternativepayments/dbsource', 'type_name');
34
+ }
35
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_Mysql4_Dbsource_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
28
+ {
29
+ public function _construct()
30
+ {
31
+ parent::_construct();
32
+ $this->_init('alternativepayments/dbsource');
33
+ }
34
+ }
35
+
36
+ ?>
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup {
28
+
29
+ }
30
+
31
+ ?>
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_Session extends Mage_Core_Model_Session_Abstract
28
+ {
29
+ public function __construct() {
30
+ $this->init('alternativepayments');
31
+ }
32
+ }
33
+ ?>
app/code/community/AlternativePaymentsInc/AlternativePayments/Model/Standard.php ADDED
@@ -0,0 +1,696 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_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 = 'alternativepayments';
34
+ protected $_formBlockType = 'alternativepayments/form';
35
+ protected $_infoBlockType = 'alternativepayments/paymentInfo';
36
+
37
+ protected $_redirectBlockType = 'alternativepayments/redirect';
38
+ protected $_responseBlockType = 'alternativepayments/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->getAchAccounttype());
55
+ $order->setAchAccountnumber($data->getAchAccountnumber());
56
+ $order->setAchRoutingnumber($data->getAchRoutingnumber());
57
+ $order->setAchChecknumber($data->getAchChecknumber());
58
+ $order->setAchPhoneVerfNum($data->getAchPhoneVerfNum());
59
+ $order->setAchSsn($data->getAchSsn());
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->getCreditcardCvv()) != 4 && $data->getCreditcardType() == 'American Express' ) {
72
+ $errorMsg = __('Please enter the 4 digits of your Card Verification Number (CVV2)');
73
+ return $errorMsg;
74
+ }
75
+ if (strlen($data->getCreditcardCvv()) != 3 && $data->getCreditcardType() != 'American Express' ) {
76
+ $errorMsg = __('Please enter the 3 digits of your Card Verification Number (CVV2)');
77
+ return $errorMsg;
78
+ }
79
+
80
+ $order->setCreditcardType($data->getCreditcardType());
81
+ $order->setCreditcardNumber($data->getCreditcardNumber());
82
+ $order->setCreditcardExpMonth($data->getCreditcardExpMonth());
83
+ $order->setCreditcardExpYear($data->getCreditcardExpYear());
84
+ $order->setCreditcardCvv($data->getCreditcardCvv());
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->getIdealBankcode());
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->getSepaIbanHidden();
113
+ return $errorMsg;
114
+ }
115
+
116
+ $order->setSepaSignum($data->getSepaSignum());
117
+ $order->setSepaIban($data->getSepaIban());
118
+ $order->setSepaBic($data->getSepaBic());
119
+
120
+ $order->setSepaIbanHidden($data->getSepaIbanHidden());
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->getBrazilpayBankcode());
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->getDirectpaymaxBankcode());
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->getEurodebitAccountnumber());
160
+ $order->setEurodebitRoutingnumber($data->getEurodebitRoutingnumber());
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->getGiropayAccountnumber());
173
+ $order->setGiropayRoutingnumber($data->getGiropayRoutingnumber());
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('alternativepayments/dbsource')->getCollection()->addFieldToFilter('type_name', $data->getAlternativepaymentsTypeName());
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->setAlternativepaymentsTypeName($paymentLabel);
215
+
216
+ if ($data->getAlternativepaymentsTypeName() != '') {
217
+ $order->setAlternativepaymentsTypeName($data->getAlternativepaymentsTypeName());
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", "TELEINGRESO", "YELLOWPAY" - special request
234
+ *
235
+ * @param Varien_Object $data
236
+ * @return
237
+ */
238
+ public function prepare_payment_send(Varien_Object $observer) {
239
+
240
+ $order = Mage::getSingleton('checkout/session')->getQuote();
241
+ $payment = $order -> getPayment();
242
+ $incrementId = $order -> getEntityId();
243
+
244
+ // filter for payment gateway
245
+ if (in_array($order->getAlternativepaymentsTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
246
+ "POLI", "PRZELEWY", "QIWI", "TELEINGRESO" ))) {
247
+ $amount = $order -> getGrandTotal();
248
+
249
+ //build request list
250
+ $cartValues = $this -> _buildRequest($order, $amount);
251
+ // post request
252
+ list($content, $response) = $this -> _postRequest($order, $cartValues);
253
+ // formated postBack result
254
+ list($isPaymentAccepted, $message) = $this->_formatPostResult($content);
255
+ // if result have error
256
+ if ($isPaymentAccepted == 'X') {
257
+
258
+ Mage::getSingleton('checkout/session')->setResponseFlagTransaction($isPaymentAccepted);
259
+ Mage::throwException(Mage::helper('paygate')->__($message));
260
+
261
+ } else {
262
+ Mage::getSingleton('checkout/session')->setResponseFlagTransaction($isPaymentAccepted);
263
+ Mage::getSingleton('checkout/session')->setResponseTestField($content);
264
+
265
+ }
266
+
267
+ return -1;
268
+ }
269
+
270
+ }
271
+
272
+ /**
273
+ * method for redirection page - integrate in magento
274
+ *
275
+ * @return automatic redirect to return url
276
+ */
277
+ public function getOrderPlaceRedirectUrl()
278
+ {
279
+
280
+ $order = Mage::getSingleton('checkout/session')->getQuote();
281
+
282
+ $payment = $order -> getPayment();
283
+ $incrementId = $order -> getEntityId();
284
+
285
+ // $order->setPricePoint($this->getConfigData('pricepoint'));
286
+
287
+
288
+ // ---- direct pay gateway method - START !!!!!! -------
289
+ if (in_array($order->getAlternativepaymentsTypeName(), array("SEPA", "EuroDebit", "ACH", "CreditCard", "BARPAY"))) {
290
+
291
+ // Mage::log(var_export($order->debug(), TRUE), null,'$cart3.log');
292
+
293
+
294
+ $check = $this -> _getOrderDirectPay($order);
295
+ if ($check == 'N' || $check == 'X') {
296
+
297
+ return Mage::getUrl('checkout/onepage/failure', array('_secure' => true));
298
+ }
299
+
300
+ // ---- direct pay gateway method - END !!!!!! -----------------------------
301
+ // ---- redirect pay gateway method - START !!!!!! -------------------------
302
+ } elseif (in_array($order->getAlternativepaymentsTypeName(), array("DIRECTPAY", "CHINADEBIT",
303
+ "BrazilPay", "DIRECTPAYMAX" ))) {
304
+
305
+ // Mage::log(var_export($order->debug(), TRUE), null,'$cart3.log');
306
+
307
+ $amount = $order -> getGrandTotal();
308
+ $cartValues = $this -> _buildRequest($order, $amount);
309
+
310
+ list($content, $response) = $this -> _postRequest($order, $cartValues);
311
+ list($isPaymentAccepted, $message) = $this->_formatPostResult($content);
312
+
313
+ $responseURL = $response['url'];
314
+
315
+ // ---- redirect pay gateway method - DIRECTPAY and DIRECTPAYMAX only !!!!!! (specific) --------
316
+ if (in_array($order->getAlternativepaymentsTypeName(), array("DIRECTPAY", "DIRECTPAYMAX"))) {
317
+
318
+ if ($isPaymentAccepted == self::RESPONSE_CODE_DECLINED || $isPaymentAccepted == self::RESPONSE_CODE_ERROR) {
319
+
320
+ $order->setStatus(self::STATUS_ERROR);
321
+ $order->save();
322
+ $orderId = $order-> getReservedOrderId();
323
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
324
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true);
325
+ $orderOBJ->save();
326
+ Mage::throwException(Mage::helper('paygate')->__('Unexpected error: '. $message));
327
+ } else {
328
+
329
+ Mage::getSingleton('alternativepayments/session')->setPostBack(serialize($content));
330
+ Mage::getSingleton('alternativepayments/session')->setBackFlag(serialize('TRUE'));
331
+
332
+ return Mage::getUrl('alternativepayments/', array('_secure' => true));
333
+
334
+ }
335
+ } else {
336
+
337
+ return $responseURL;
338
+
339
+ }
340
+
341
+ // filter for specific payment gateway
342
+ } elseif (in_array($order->getAlternativepaymentsTypeName(), array("YELLOWPAY", "EPS", "IDEAL", "GIROPAY", "PAYSAFE",
343
+ "POLI", "PRZELEWY", "QIWI", "TELEINGRESO" ))) {
344
+
345
+ $responseURL = Mage::getSingleton('checkout/session')->getResponseTestField();
346
+
347
+ return $responseURL;
348
+
349
+ } else {
350
+
351
+ $order->setStatus(self::STATUS_ERROR);
352
+ $order->save();
353
+ $orderId = $order-> getReservedOrderId();
354
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
355
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, 'Unexpected error' );
356
+ $orderOBJ->save();
357
+ Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
358
+ }
359
+
360
+ // return Mage::getUrl(Mage::getSingleton('checkout/session')->getTestField(), array('_secure' => true));
361
+
362
+ }
363
+
364
+ /**
365
+ * methode for prepere and send infroramtion on service, checking and info client
366
+ *
367
+ * @param Varien_Object $cart
368
+ * @return automatic redirect to return url
369
+ */
370
+ protected function _getOrderDirectPay(Varien_Object $cart)
371
+ {
372
+
373
+ $amount = $cart -> getGrandTotal();
374
+ if ($amount <= 0) {
375
+ Mage::throwException(Mage::helper('paygate')->__('Invalid amount for authorization.'));
376
+ }
377
+
378
+ $cartValues = $this->_buildRequest($cart, $amount);
379
+ list($content, $response) = $this->_postRequest($cart, $cartValues);
380
+ list($isPaymentAccepted, $message) = $this->_formatPostResult($content);
381
+
382
+ $this->_getStatusMessage($cart, $isPaymentAccepted, $message);
383
+
384
+ return $isPaymentAccepted;
385
+ }
386
+
387
+ /**
388
+ * methode for save place order result in database
389
+ *
390
+ * @param Varien_Object $cart
391
+ * @param var $isPaymentAccepted
392
+ * @param String $message
393
+ * @return void
394
+ */
395
+ protected function _getStatusMessage($cart, $isPaymentAccepted, $message)
396
+ {
397
+
398
+ switch ($isPaymentAccepted) {
399
+ case self::RESPONSE_CODE_APPROVED:
400
+ $cart->setStatus(self::STATUS_APPROVED);
401
+ $cart->save();
402
+ $orderId = $cart-> getReservedOrderId();
403
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
404
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_PROCESSING, "Order has been successfully paid");
405
+ $orderOBJ->setStatus('processing_paid');
406
+ $orderOBJ->save();
407
+ break;
408
+
409
+ case self::RESPONSE_CODE_PENDING:
410
+ $cart->setStatus(self::STATUS_APPROVED);
411
+ $cart->save();
412
+ $orderId = $cart-> getReservedOrderId();
413
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
414
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_NEW, true, "Order is pending");
415
+ $orderOBJ->setStatus('pending');
416
+ $orderOBJ->save();
417
+ break;
418
+
419
+ case self::RESPONSE_CODE_DECLINED:
420
+ $cart->setStatus(self::STATUS_DECLINED);
421
+ $cart->save();
422
+ $orderId = $cart-> getReservedOrderId();
423
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
424
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Order has been canceled by payment service");
425
+ $orderOBJ->setStatus('canceled');
426
+ $orderOBJ->save();
427
+ break;
428
+
429
+ case self::RESPONSE_CODE_ERROR:
430
+ $cart->setStatus(self::STATUS_ERROR);
431
+ $cart->save();
432
+ $orderId = $cart-> getReservedOrderId();
433
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
434
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Unexpected error - $message");
435
+ $orderOBJ->setStatus('canceled');
436
+ $orderOBJ->save();
437
+ break;
438
+
439
+ default:
440
+ $cart->setStatus(self::STATUS_ERROR);
441
+ $cart->save();
442
+ $orderId = $cart-> getReservedOrderId();
443
+ $orderOBJ = Mage::getModel('sales/order')->loadByIncrementId("$orderId");
444
+ $orderOBJ->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Unexpected error - $message !" );
445
+ $orderOBJ->save();
446
+ Mage::throwException(Mage::helper('paygate')->__('Unexpected error'));
447
+ }
448
+
449
+ }
450
+
451
+
452
+ /**
453
+ * methode for arrange postResult
454
+ *
455
+ * @param String $result_dirty
456
+ * @return Array
457
+ */
458
+ protected function _formatPostResult($result_dirty)
459
+ {
460
+ $match = explode("|",$result_dirty, 2);
461
+ $flag_r = substr($match[0], 0, 1);
462
+
463
+ return array($flag_r, $match[1]);
464
+ }
465
+
466
+ /**
467
+ * methode for building request for service
468
+ *
469
+ * @param Varien_Object $cart
470
+ * @return Array - list for post
471
+ */
472
+ protected function _buildRequest(Varien_Object $cart)
473
+ {
474
+ if (!empty($cart)) {
475
+ $billing = $cart->getBillingAddress();
476
+ if (!empty($billing)) {
477
+ if (!$billing->getRegion())
478
+ $billing->setRegion('NA');
479
+
480
+ $fields = array(
481
+ "amount" => $cart->getGrandTotal(), // charge amount in specified currency
482
+ "paydesc" => "", // (optional) Description of purchase
483
+ "firstName" => $billing->getFirstname(),
484
+ "lastName" => $billing->getLastname(),
485
+ "address" => $billing->getStreet(1)." ".$billing->getStreet(2),
486
+ "city" => $billing->getCity(),
487
+ "state" => $billing->getRegion(),
488
+ "zip" => $billing->getPostcode(),
489
+ "email" => $cart->getCustomerEmail(),
490
+ //"STATUS_URL" => "mailto:" . $config["Company"]["orders_department"], /company mail/
491
+ "Fax" => $billing->getFax(),
492
+ "Phone" => $billing->getTelephone(), //required - optional for some bank (this is not global filed!!)
493
+ "IP" => $cart->getRemoteIp(),
494
+ "username" => "notused",
495
+ "userpassword" => "notused",
496
+ // "memberLen" => 30, // (optional)
497
+ "xfield" => $cart-> getReservedOrderId(), //Order Protect Code
498
+
499
+ "currencyid" => $cart->getQuoteCurrencyCode(), //order_currency_code ORDER -- 'global_currency_code' => 'EUR', 'base_currency_code' => 'EUR', 'store_currency_code' => 'EUR', 'order_currency_code' => 'EUR',
500
+ "country" => $billing->getCountry(),
501
+ "processmode" => $cart->getMode(), // TESTAPPROVE, TESTDECLINE , PRODUCTION
502
+ );
503
+
504
+ if ($cart->getAlternativepaymentsTypeName() == 'EuroDebit') {
505
+
506
+ $fields_tmp = array(
507
+
508
+ "pricepoint" => $cart->getPricePoint(),
509
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
510
+ "accountnumber" => $cart->getEurodebitAccountnumber(),
511
+ "routingnumber" => $cart->getEurodebitRoutingnumber(),
512
+ );
513
+
514
+ } elseif ($cart->getAlternativepaymentsTypeName() == 'GIROPAY') {
515
+
516
+ $fields_tmp = array(
517
+
518
+ "authredirectmode" => 'H',
519
+ "pricepoint" => $cart->getPricePoint(),
520
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
521
+ "accountnumber" => $cart->getGiropayAccountnumber(),
522
+ "routingnumber" => $cart->getGiropayRoutingnumber(),
523
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
524
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
525
+ );
526
+
527
+ } elseif ($cart->getAlternativepaymentsTypeName() == 'SEPA') {
528
+
529
+ $fields_tmp = array(
530
+
531
+ "pricepoint" => $cart->getPricePoint(),
532
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
533
+ "signum" => $cart->getSepaSignum(),
534
+ "iban" => $cart->getSepaIban(),
535
+ "bic" => $cart->getSepaBic(),
536
+ );
537
+
538
+ } elseif ($cart->getAlternativepaymentsTypeName() == 'CreditCard') {
539
+
540
+ $fields_tmp = array(
541
+
542
+ "pricepoint" => $cart->getPricePoint(),
543
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
544
+ "cctype" => $cart->getCreditcardType(),
545
+ "ccnum" => $cart->getCreditcardNumber(),
546
+ "cvv2" => $cart->getCreditcardCvv(),
547
+ "ccexpiremonth" => $cart->getCreditcardExpMonth(),
548
+ "ccexpireyear" => $cart->getCreditcardExpYear(),
549
+ );
550
+
551
+ } elseif (in_array($cart->getAlternativepaymentsTypeName(), array("QIWI", "POLI", "PAYSAFE", "TELEINGRESO",
552
+ "PRZELEWY", "EPS", "YELLOWPAY", "CHINADEBIT"))) {
553
+
554
+ $fields_tmp = array(
555
+
556
+ "authredirectmode" => 'H',
557
+ "pricepoint" => $cart->getPricePoint(),
558
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
559
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
560
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
561
+
562
+
563
+ );
564
+
565
+ } elseif ($cart->getAlternativepaymentsTypeName() == 'IDEAL') {
566
+
567
+ $fields_tmp = array(
568
+
569
+ "authredirectmode" => 'H',
570
+ "pricepoint" => $cart->getPricePoint(),
571
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
572
+ "bankcode" => $cart->getIdealBankcode(),
573
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
574
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
575
+ );
576
+
577
+ } elseif (in_array($cart->getAlternativepaymentsTypeName(), array("DIRECTPAY", "BARPAY"))) {
578
+
579
+ $fields_tmp = array(
580
+
581
+ "pricepoint" => $cart->getPricePoint(),
582
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
583
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
584
+ );
585
+
586
+ } elseif ($cart->getAlternativepaymentsTypeName() == 'DIRECTPAYMAX') {
587
+
588
+ $fields_tmp = array(
589
+
590
+ "pricepoint" => $cart->getPricePoint(),
591
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
592
+ "bankCode" => $cart->getDirectpaymaxBankcode(),
593
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
594
+ );
595
+
596
+ } elseif ($cart->getAlternativepaymentsTypeName() == 'BrazilPay') {
597
+
598
+ $fields_tmp = array(
599
+
600
+ "pricepoint" => $cart->getPricePoint(),
601
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
602
+ "gatewayid" => 2,
603
+ "deposittype" => 2, // required if gatewayid is 1
604
+ "resultredirecturl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
605
+ "postbackurl" => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."alternativepayments/payment/redirect/",
606
+ "bankcode" => $cart->getBrazilpayBankcode(), // required if gatewayid is 1
607
+ "cpf" => "123456789", // required if gatewayid is 1
608
+ );
609
+
610
+ } elseif ($cart->getAlternativepaymentsTypeName() == 'ACH') {
611
+
612
+ $fields_tmp = array(
613
+
614
+ "pricepoint" => $cart->getPricePoint(),
615
+ "paymenttype" => $cart->getAlternativepaymentsTypeName(),
616
+ "accounttype" => $cart->getAchAccounttype(),
617
+ "accountnumber" => $cart->getAchAccountnumber(),
618
+ "routingnumber" => $cart->getAchRoutingnumber(),
619
+ "checknumber" => $cart->getAchChecknumber(),
620
+ "phoneverfnum" => $cart->getAchPhoneVerfNum(),
621
+
622
+ "ssn" => $cart->getAchSsn(),
623
+ );
624
+ }
625
+
626
+ $fields = $fields + $fields_tmp;
627
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/fields$$$.txt", print_r($fields, true), FILE_APPEND);
628
+ return $fields;
629
+ }
630
+ }
631
+
632
+ return $cartValues;
633
+ }
634
+
635
+ /**
636
+ * post request methode
637
+ *
638
+ * @param Varien_Object $cart
639
+ * @param Array $cartValues - list for post
640
+ * @return Array
641
+ */
642
+ protected function _postRequest(Varien_Object $cart, $cartValues)
643
+ {
644
+ try {
645
+ $postData = http_build_query($cartValues);
646
+
647
+
648
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/cartValues$$$.txt", print_r($cartValues, true), FILE_APPEND);
649
+
650
+ $urlToPost = $cart->getUrlcode();
651
+ // Create a curl request and send the values
652
+ $ch = curl_init();
653
+ curl_setopt($ch, CURLOPT_URL, $urlToPost);
654
+ curl_setopt($ch, CURLOPT_TIMEOUT, 180);
655
+ curl_setopt($ch, CURLOPT_HEADER, false);
656
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
657
+ curl_setopt($ch, CURLOPT_POST, true);
658
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); //Put the created string here in use
659
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
660
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
661
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
662
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
663
+
664
+ $content = curl_exec($ch); //The string returned
665
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/content$$$.txt", $content, FILE_APPEND);
666
+ $response = curl_getinfo($ch);
667
+ // file_put_contents(Mage::getBaseDir('base')."/var/log/response$$$.txt", print_r($response, true), FILE_APPEND);
668
+ curl_close ($ch);
669
+
670
+ if ($response['http_code'] == 301 || $response['http_code'] == 302)
671
+ {
672
+ ini_set("user_agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1");
673
+ $headers = get_headers($response['url']);
674
+
675
+ $location = "";
676
+ foreach($headers as $value)
677
+ {
678
+ if (substr(strtolower($value), 0, 9) == "location:")
679
+ return get_final_url(trim(substr($value, 9, strlen($value))));
680
+ }
681
+ }
682
+
683
+ if ($response['http_code'] && substr($response['http_code'], 0, 2) != "20") { //Unsuccessful post request...
684
+ throw new Exception("Returned HTTP CODE: " . $response['http_code'] . " for this URL: " . $urlToPost);
685
+ }
686
+
687
+ } catch (Exception $e) {
688
+
689
+ Mage::throwException($e->getMessage());
690
+ }
691
+
692
+ return array($content, $response);
693
+ }
694
+
695
+ }
696
+
app/code/community/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_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/AlternativePaymentsInc/AlternativePayments/Model/System/Config/Source/Payment/Alternativepaymenttype.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 Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_Model_System_Config_Source_Payment_AlternativePaymentType extends AlternativePaymentsInc_AlternativePayments_Model_System_Config_Source_Allowtypeall
28
+ {
29
+
30
+
31
+ public function toOptionArray()
32
+ {
33
+ $dbSourceList = Mage::getModel('alternativepayments/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/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_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/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_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
+ 'alternativepayments',
37
+ array('template' => 'alternativepayments/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
+ 'alternativepayments',
51
+ array('template' => 'alternativepayments/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
+ 'alternativepayments',
66
+ array('template' => 'alternativepayments/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
+ 'alternativepayments',
81
+ array('template' => 'alternativepayments/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/AlternativePaymentsInc/AlternativePayments/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 AlternativePaymentsInc_AlternativePayments
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class AlternativePaymentsInc_AlternativePayments_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','alternativepayments',array('template' => 'alternativepayments/redirect.phtml'));
34
+ $this->getLayout()->getBlock('content')->append($block);
35
+
36
+ $this->renderLayout();
37
+ }
38
+
39
+ }
app/code/community/AlternativePaymentsInc/AlternativePayments/etc/config.xml ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
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
+ <config>
23
+ <modules>
24
+ <AlternativePaymentsInc_AlternativePayments>
25
+ <version>1.0.0</version>
26
+ </AlternativePaymentsInc_AlternativePayments>
27
+ </modules>
28
+
29
+ <global>
30
+ <fieldsets>
31
+ <sales_convert_quote_payment>
32
+ <alternativepayments_type_name>
33
+ <to_order_payment>*</to_order_payment>
34
+ </alternativepayments_type_name>
35
+ </sales_convert_quote_payment>
36
+ </fieldsets>
37
+ <models>
38
+ <alternativepayments>
39
+ <class>AlternativePaymentsInc_AlternativePayments_Model</class>
40
+ <resourceModel>alternativepayments_mysql4</resourceModel>
41
+ </alternativepayments>
42
+ <alternativepayments_mysql4>
43
+ <class>AlternativePaymentsInc_AlternativePayments_Model_Mysql4</class>
44
+ <entities>
45
+ <dbsource>
46
+ <table>alternativepayments_resource</table>
47
+ </dbsource>
48
+ <dbiban>
49
+ <table>alternativepayments_iban</table>
50
+ </dbiban>
51
+ </entities>
52
+ </alternativepayments_mysql4>
53
+ </models>
54
+ <resources>
55
+ <alternativepayments_setup>
56
+ <setup>
57
+ <module>AlternativePaymentsInc_AlternativePayments</module>
58
+ <class>AlternativePaymentsInc_AlternativePayments_Model_Resource_Setup</class>
59
+ </setup>
60
+ </alternativepayments_setup>
61
+ <alternativepayments_write>
62
+ <connection>
63
+ <use>core_write</use>
64
+ </connection>
65
+ </alternativepayments_write>
66
+ <alternativepayments_read>
67
+ <connection>
68
+ <use>core_read</use>
69
+ </connection>
70
+ </alternativepayments_read>
71
+ </resources>
72
+ <helpers>
73
+ <alternativepayments>
74
+ <class>AlternativePaymentsInc_AlternativePayments_Helper</class>
75
+ </alternativepayments>
76
+ </helpers>
77
+ <blocks>
78
+ <alternativepayments>
79
+ <class>AlternativePaymentsInc_AlternativePayments_Block</class>
80
+ </alternativepayments>
81
+ </blocks>
82
+ </global>
83
+ <default>
84
+ <payment>
85
+ <alternativepayments>
86
+ <model>alternativepayments/standard</model>
87
+ <active>1</active>
88
+ <order_status>pending</order_status>
89
+ <title>Alternative Payments</title>
90
+ <payment_action>sale</payment_action>
91
+ <allowspecific>0</allowspecific>
92
+ <sort_order>33</sort_order>
93
+
94
+
95
+ <!--
96
+ <ppach>defaultvalue1</ppach>
97
+ <ppbarpay>defaultvalue2</ppbarpay>
98
+ <ppdirectpay>defaultvalue3</ppdirectpay>
99
+ <ppdirectpaymax>defaultvalue4</ppdirectpaymax>
100
+ -->
101
+
102
+
103
+ </alternativepayments>
104
+ </payment>
105
+ </default>
106
+ <frontend>
107
+ <events>
108
+ <sales_model_service_quote_submit_before>
109
+ <observers>
110
+ <alternativepayments>
111
+ <type>singleton</type>
112
+ <class>AlternativePaymentsInc_AlternativePayments_Model_Standard</class>
113
+ <method>prepare_payment_send</method>
114
+ </alternativepayments>
115
+ </observers>
116
+ </sales_model_service_quote_submit_before>
117
+ </events>
118
+ <translate>
119
+ <modules>
120
+ <AlternativePaymentsInc_AlternativePayments>
121
+ <files>
122
+ <default>AlternativePaymentsInc_AlternativePayments.csv</default>
123
+ </files>
124
+ </AlternativePaymentsInc_AlternativePayments>
125
+ </modules>
126
+ </translate>
127
+ <routers>
128
+ <alternativepayments>
129
+ <use>standard</use>
130
+ <args>
131
+ <module>AlternativePaymentsInc_AlternativePayments</module>
132
+ <frontName>alternativepayments</frontName>
133
+ </args>
134
+ </alternativepayments>
135
+ </routers>
136
+ <layout>
137
+ <updates>
138
+ <alternativepayments>
139
+ <file>alternativepayments.xml</file>
140
+ </alternativepayments>
141
+ </updates>
142
+ </layout>
143
+ </frontend>
144
+ <adminhtml>
145
+ <translate>
146
+ <modules>
147
+ <AlternativePaymentsInc_AlternativePayments>
148
+ <files>
149
+ <default>AlternativePaymentsInc_AlternativePayments.csv</default>
150
+ </files>
151
+ </AlternativePaymentsInc_AlternativePayments>
152
+ </modules>
153
+ </translate>
154
+ </adminhtml>
155
+ </config>
app/code/community/AlternativePaymentsInc/AlternativePayments/etc/system.xml ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
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
+ <config>
23
+ <sections>
24
+ <payment>
25
+ <groups>
26
+ <alternativepayments translate="label comment" module="paygate">
27
+ <label>Alternative Payments</label>
28
+ <comment>&lt;strong&gt;Please note&lt;/strong&gt;: If you have not registered yet visit the &lt;a href="http://www.alternativepayments.com/" target="_blank"&gt;Alternative Payments&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 Alternative Payments</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 Alternative Payments</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 Alternative Payments</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 Alternative Payments</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>alternativepayments/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>alternativepayments/system_config_source_payment_alternativepaymenttype</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_yellowpay translate="label">
227
+ <label>Price Point for "YellowPay"</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_yellowpay>
234
+ <!--
235
+ <order_status translate="label">
236
+ <label>New Order Status</label>
237
+ <frontend_type>select</frontend_type>
238
+ <source_model>adminhtml/system_config_source_order_status</source_model>
239
+ <sort_order>50</sort_order>
240
+ <show_in_default>1</show_in_default>
241
+ <show_in_website>1</show_in_website>
242
+ <show_in_store>0</show_in_store>
243
+ </order_status>
244
+ -->
245
+ <allowspecific translate="label">
246
+ <label>Payment Applicable From</label>
247
+ <frontend_type>select</frontend_type>
248
+ <sort_order>70</sort_order>
249
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
250
+ <show_in_default>1</show_in_default>
251
+ <show_in_website>1</show_in_website>
252
+ <show_in_store>0</show_in_store>
253
+ </allowspecific>
254
+
255
+ <specificcountry translate="label">
256
+ <label>Countries Payment Applicable From</label>
257
+ <frontend_type>multiselect</frontend_type>
258
+ <sort_order>71</sort_order>
259
+ <source_model>adminhtml/system_config_source_country</source_model>
260
+ <show_in_default>1</show_in_default>
261
+ <show_in_website>1</show_in_website>
262
+ <show_in_store>0</show_in_store>
263
+ <depends>
264
+ <allowspecific>1</allowspecific>
265
+ </depends>
266
+ </specificcountry>
267
+ <payment_mode translate="label">
268
+ <label>Test Mode</label>
269
+ <frontend_type>select</frontend_type>
270
+ <source_model>alternativepayments/system_config_source_testmode</source_model>
271
+ <sort_order>80</sort_order>
272
+ <show_in_default>1</show_in_default>
273
+ <show_in_website>1</show_in_website>
274
+ <show_in_store>0</show_in_store>
275
+ </payment_mode>
276
+ <sort_order translate="label">
277
+ <label>Sort Order</label>
278
+ <frontend_type>text</frontend_type>
279
+ </sort_order>
280
+ <sort_order>90</sort_order>
281
+ <show_in_default>1</show_in_default>
282
+ <show_in_website>1</show_in_website>
283
+ <show_in_store>0</show_in_store>
284
+ </fields>
285
+ </alternativepayments>
286
+ </groups>
287
+ </payment>
288
+ </sections>
289
+ </config>
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
24
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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 AlternativePaymentsInc_AlternativePayments <br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $installer->run("
35
+
36
+ INSERT INTO `{$this->getTable('sales/order_status')}` (
37
+ `status`, `label`
38
+ ) VALUES (
39
+ 'processing_paid', 'Processing (Successfully Paid)'
40
+ );
41
+ INSERT INTO `{$this->getTable('sales/order_status_state')}` (
42
+ `status`, `state`, `is_default`
43
+ ) VALUES (
44
+ 'processing_paid', 'processing', '1'
45
+ );
46
+
47
+ ");
48
+
49
+ $installer->endSetup();
50
+
51
+ ?>
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.1.0-0.1.4.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
24
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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 AlternativePaymentsInc_AlternativePayments<br />';
30
+
31
+ $installer = $this;
32
+
33
+ $installer->startSetup();
34
+
35
+ $installer->run("
36
+
37
+ ALTER TABLE `{$this->getTable('sales/quote_payment')}` ADD `alternativepayments_type_name` VARCHAR( 255 );
38
+ ALTER TABLE `{$this->getTable('sales/order_payment')}` ADD `alternativepayments_type_name` VARCHAR( 255 );
39
+ ");
40
+
41
+ $installer->endSetup();
42
+
43
+
44
+
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.1.4-0.2.0.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
24
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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 AlternativePaymentsInc_AlternativePayments<br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $installer->run("
35
+
36
+ DROP TABLE IF EXISTS {$this->getTable('alternativepayments_resource')};
37
+ CREATE TABLE `{$this->getTable('alternativepayments_resource')}`
38
+ (
39
+ type_name VARCHAR(255) NOT NULL UNIQUE,
40
+ type_label VARCHAR(255) NOT NULL,
41
+ allow_country TEXT NOT NULL
42
+ ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
43
+
44
+
45
+ INSERT INTO `{$this->getTable('alternativepayments_resource')}`
46
+ (`type_name`, `type_label`, `allow_country` )
47
+ VALUES
48
+ ( 'ACH', 'ACH - Online Check', 'US|CA' ),
49
+ ( 'BARPAY', 'BARPAY', 'DE' ),
50
+ ( 'EPS', 'EPS', 'AT' ),
51
+ ( 'IDEAL', 'iDEAL', 'NL' ),
52
+ ( 'GIROPAY', 'GiroPay', 'DE' ),
53
+ ( 'YELLOWPAY', 'YellowPay', 'CH' ),
54
+ ( 'EuroDebit', 'EuroDebit', 'DE|AT|NL' ),
55
+ ( 'DIRECTPAYMAX', 'Pay by Bank', 'DE|US' ),
56
+ ( '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' ),
57
+ ( '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' ),
58
+ ( 'POLI', 'POLi', 'AU|NZ' ),
59
+ ( 'PRZELEWY', 'Przelewy24', 'PL' ),
60
+ ( 'TELEINGRESO', 'Teleingreso', 'ES' ),
61
+ ( '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' ),
62
+ ( 'QIWI', 'QIWI', 'RU' );
63
+
64
+ ");
65
+
66
+ // ( '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' ),
67
+ // ( 'BrazilPay', 'BrazilPay', 'BR' ),
68
+ // ( 'CHINADEBIT', 'China Debit', 'CN' ),
69
+ // ( 'FASTERPAY', 'FasterPay', 'GB' ),
70
+
71
+ $installer->endSetup();
72
+
73
+
74
+
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.2.0-0.2.2.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
24
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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 AlternativePaymentsInc_AlternativePayments<br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $installer->run("
35
+
36
+ DROP TABLE IF EXISTS {$this->getTable('alternativepayments_iban')};
37
+ CREATE TABLE `{$this->getTable('alternativepayments_iban')}`
38
+ (
39
+ country VARCHAR(255) NOT NULL,
40
+ country_id VARCHAR(255) NOT NULL UNIQUE,
41
+ bank_code VARCHAR(255) NOT NULL,
42
+ account_number VARCHAR(255) NOT NULL
43
+ ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
44
+
45
+ INSERT INTO `{$this->getTable('alternativepayments_iban')}`
46
+ (`country`, `country_id`, `bank_code`, `account_number` )
47
+ VALUES
48
+ ('Andorra', 'AD', '0 4n 4n', '0 12 0 '),
49
+ ('Albania', 'AL', '0 8n 0 ', '0 16 0 '),
50
+ ('Austria', 'AT', '0 5n 0 ', '0 11n 0 '),
51
+ ('Bosnia and Herzegovina',
52
+ 'BA', '0 3n 3n', '0 8n 2n'),
53
+ ('Belgium', 'BE', '0 3n 0 ', '0 7n 2n'),
54
+ ('Bulgaria', 'BG', '0 4a 4n', '2n 8 0 '),
55
+ ('Switzerland', 'CH', '0 5n 0 ', '0 12 0 '),
56
+ ('Cyprus', 'CY', '0 3n 5n', '0 16 0 '),
57
+ ('Czech Republic', 'CZ', '0 4n 0 ', '0 16n 0 '),
58
+ ('Germany', 'DE', '0 8n 0 ', '0 10n 0 '),
59
+ ('Denmark', 'DK', '0 4n 0 ', '0 9n 1n'),
60
+ ('Estonia', 'EE', '0 2n 0 ', '2n 11n 1n'),
61
+ ('Spain', 'ES', '0 4n 4n', '2n 10n 0 '),
62
+ ('Finland', 'FI', '0 6n 0 ', '0 7n 1n'),
63
+ ('Faroe Islands', 'FO', '0 4n 0 ', '0 9n 1n'),
64
+ ('France', 'FR', '0 5n 5n', '0 11 2n'),
65
+ ('United Kingdom', 'GB', '0 4a 6n', '0 8n 0 '),
66
+ ('Georgia', 'GE', '0 2a 0 ', '0 16n 0 '),
67
+ ('Gibraltar', 'GI', '0 4a 0 ', '0 15 0 '),
68
+ ('Greenland', 'GL', '0 4n 0 ', '0 9n 1n'),
69
+ ('Greece', 'GR', '0 3n 4n', '0 16 0 '),
70
+ ('Croatia', 'HR', '0 7n 0 ', '0 10n 0 '),
71
+ ('Hungary', 'HU', '0 3n 4n', '1n 15n 1n'),
72
+ ('Ireland', 'IE', '0 4a 6n', '0 8n 0 '),
73
+ ('Israel', 'IL', '0 3n 3n', '0 13n 0 '),
74
+ ('Iceland', 'IS', '0 4n 0 ', '2n 16n 0 '),
75
+ ('Italy', 'IT', '1a 5n 5n', '0 12 0 '),
76
+ ('Kuwait', 'KW', '0 4a 0 ', '0 22 0 '),
77
+ ('Kazakhstan', 'KZ', '0 3n 0 ', '0 13 0 '),
78
+ ('Lebanon', 'LB', '0 4n 0 ', '0 20 0 '),
79
+ ('Liechtenstein', 'LI', '0 5n 0 ', '0 12 0 '),
80
+ ('Lithuania', 'LT', '0 5n 0 ', '0 11n 0 '),
81
+ ('Luxembourg', 'LU', '0 3n 0 ', '0 13 0 '),
82
+ ('Latvia', 'LV', '0 4a 0 ', '0 13 0 '),
83
+ ('Monaco', 'MC', '0 5n 5n', '0 11 2n'),
84
+ ('Montenegro', 'ME', '0 3n 0 ', '0 13n 2n'),
85
+ ('Macedonia, Former Yugoslav Republic of',
86
+ 'MK', '0 3n 0 ', '0 10 2n'),
87
+ ('Mauritania', 'MR', '0 5n 5n', '0 11n 2n'),
88
+ ('Malta', 'MT', '0 4a 5n', '0 18 0 '),
89
+ ('Mauritius', 'MU', '0 4a 4n', '0 15n 3a'),
90
+ ('Netherlands', 'NL', '0 4a 0 ', '0 10n 0 '),
91
+ ('Norway', 'NO', '0 4n 0 ', '0 6n 1n'),
92
+ ('Poland', 'PL', '0 8n 0 ', '0 16n 0 '),
93
+ ('Portugal', 'PT', '0 4n 4n', '0 11n 2n'),
94
+ ('Romania', 'RO', '0 4a 0 ', '0 16 0 '),
95
+ ('Serbia', 'RS', '0 3n 0 ', '0 13n 2n'),
96
+ ('Saudi Arabia', 'SA', '0 2n 0 ', '0 18 0 '),
97
+ ('Sweden', 'SE', '0 3n 0 ', '0 16n 1n'),
98
+ ('Slovenia', 'SI', '0 5n 0 ', '0 8n 2n'),
99
+ ('Slovak Republic',
100
+ 'SK', '0 4n 0 ', '0 16n 0 '),
101
+ ('San Marino', 'SM', '1a 5n 5n', '0 12 0 '),
102
+ ('Tunisia', 'TN', '0 2n 3n', '0 13n 2n'),
103
+ ('Turkey', 'TR', '0 5n 0 ', '1 16 0 ')
104
+
105
+ ");
106
+
107
+
108
+ $installer->endSetup();
109
+
110
+
111
+
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.2.2-0.2.3.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
24
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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 AlternativePaymentsInc_AlternativePayments<br />';
29
+
30
+ $installer = $this;
31
+
32
+ $installer->startSetup();
33
+
34
+ $installer->run("
35
+
36
+ DROP TABLE IF EXISTS {$this->getTable('alternativepayments_resource')};
37
+ CREATE TABLE `{$this->getTable('alternativepayments_resource')}`
38
+ (
39
+ type_name VARCHAR(255) NOT NULL UNIQUE,
40
+ type_label VARCHAR(255) NOT NULL,
41
+ allow_country TEXT NOT NULL,
42
+ validation VARCHAR(255) NOT NULL
43
+ ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
44
+
45
+ INSERT INTO `{$this->getTable('alternativepayments_resource')}`
46
+ (`type_name`, `type_label`, `allow_country`, `validation` )
47
+ VALUES
48
+ ( 'ACH', 'ACH - Online Check', 'US|CA', 'achValidation' ),
49
+ ( 'BARPAY', 'BARPAY', 'DE', 'emptyValidation' ),
50
+ ( 'EPS', 'EPS', 'AT', 'emptyValidation' ),
51
+ ( 'IDEAL', 'iDEAL', 'NL', 'idealValidation' ),
52
+ ( 'GIROPAY', 'GiroPay', 'DE', 'giropayValidation' ),
53
+ ( 'YELLOWPAY', 'YellowPay', 'CH', 'emptyValidation' ),
54
+ ( 'EuroDebit', 'EuroDebit', 'DE|AT|NL', 'eurodebitValidation' ),
55
+ ( 'DIRECTPAYMAX', 'Pay by Bank', 'DE|US', 'directpaymaxValidation' ),
56
+ ( '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' ),
57
+ ( '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' ),
58
+ ( 'POLI', 'POLi', 'AU|NZ', 'emptyValidation' ),
59
+ ( 'PRZELEWY', 'Przelewy24', 'PL', 'emptyValidation' ),
60
+ ( 'TELEINGRESO', 'Teleingreso', 'ES', 'emptyValidation' ),
61
+ ( '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' ),
62
+ ( 'QIWI', 'QIWI', 'RU', 'emptyValidation' );
63
+
64
+ ");
65
+
66
+ // ( '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' ),
67
+ // ( 'BrazilPay', 'BrazilPay', 'BR', 'brazilpayValidation' ),
68
+ // ( 'CHINADEBIT', 'China Debit', 'CN', 'emptyValidation' ),
69
+ // ( 'FASTERPAY', 'FasterPay', 'GB' ),
70
+
71
+ $installer->endSetup();
72
+
73
+
74
+
app/code/community/AlternativePaymentsInc/AlternativePayments/sql/alternativepayments_setup/mysql4-upgrade-0.2.3-1.0.0.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AlternativePaymentsInc_AlternativePayments
24
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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 AlternativePaymentsInc_AlternativePayments<br />';
29
+
30
+ /*
31
+ $installer = $this;
32
+
33
+ $installer->startSetup();
34
+
35
+
36
+ // ( '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' ),
37
+ // ( 'BrazilPay', 'BrazilPay', 'BR', 'brazilpayValidation' ),
38
+ // ( 'CHINADEBIT', 'China Debit', 'CN', 'emptyValidation' ),
39
+ // ( 'FASTERPAY', 'FasterPay', 'GB' ),
40
+
41
+ $installer->endSetup();
42
+ */
43
+
44
+
app/design/frontend/base/default/layout/alternativepayments.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
+ <alternativepayments_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
+ </alternativepayments_processing_payment>
33
+
34
+ <default>
35
+ <reference name="head">
36
+ <action method="addItem"><type>skin_css</type><file>alternativepayments/css/styles.css</file></action>
37
+ </reference>
38
+ </default>
39
+
40
+ </layout>
41
+
42
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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('alternativepayments/session')->getYYY());
35
+
36
+ //endif;
37
+ ?>
38
+
39
+ <?php // echo $value2; ?>
40
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/allowtypeall',Mage::app()->getStore());
34
+ $specificType = Mage::getStoreConfig('payment/alternativepayments/allowspecifictype',Mage::app()->getStore());
35
+ $specificTypeList = explode(",",$specificType);
36
+
37
+ $dbSourceList = Mage::getModel('alternativepayments/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 strtolower($object); ?>-ssn-field").show(400);
102
+ <?php } else { ?>
103
+ jQuery("#<?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 strtolower($object); ?>-routingnumber-field").show(400);
108
+ <?php } else { ?>
109
+ jQuery("#<?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/alternativepayments/form/ach.phtml ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ $clientaccount = Mage::getStoreConfig('payment/alternativepayments/clientaccount',Mage::app()->getStore());
29
+ $keyaccount = Mage::getStoreConfig('payment/alternativepayments/keyaccount',Mage::app()->getStore());
30
+
31
+ ?>
32
+
33
+ <script type="text/javascript">
34
+ //<![CDATA[
35
+
36
+ // show popup window with info - Signature
37
+ function togglePhoneValToolTip(event){
38
+ if($('ach-make-tool-tip')){
39
+ $('ach-make-tool-tip').setStyle({
40
+ top: (Event.pointerY(event)-800)+'px'//,
41
+ // left: (Event.pointerX(event)+100)+'px'
42
+ })
43
+ $('ach-make-tool-tip').toggle();
44
+ }
45
+ Event.stop(event);
46
+ }
47
+ if($('ach-make-tool-tip-close')){
48
+ Event.observe($('ach-make-tool-tip-close'), 'click', togglePhoneValToolTip);
49
+ }
50
+
51
+ $$('.ach-phone-verf-make-tool').each(function(element){
52
+ Event.observe(element, 'click', togglePhoneValToolTip);
53
+ });
54
+
55
+
56
+
57
+ Validation.add('validate-ach-ssn', '<?php echo __('Please enter the last 4 digits of your Social Security Number') ?>', {
58
+ minLength : 4
59
+ });
60
+
61
+ Validation.add('validate-ach-phone-verf-num', "<?php echo __('Phone Verification Number should be 8 digits') ?>", {
62
+ minLength : 8
63
+ });
64
+
65
+ //]]>
66
+ </script>
67
+
68
+ <div class="tool-tip" id="ach-make-tool-tip" style="display:none;">
69
+ <div class="btn-close"><a href="#" id="ach-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
70
+ <div class="tool-tip-content ach-tool-tip-content">
71
+ <strong><?php echo $this->__('Phone Verification - Description') ?></strong>
72
+ <br><br>
73
+ <center>
74
+ <table>
75
+ <tbody>
76
+ <tr>
77
+ <td>
78
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/phoneverf1.jpg') ?>" />
79
+ </td>
80
+ <td class="last">
81
+ <?php echo $this->__('To get phone verification number, enter your phone number, choose your method, and click "Continue" button') ?>
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <td>
86
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/phoneverf2.jpg') ?>" />
87
+ </td>
88
+ <td class="last">
89
+ <?php echo $this->__('You will receive a call or text message from our system telling you the PIN number') ?>
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <td>
94
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/phoneverf3.jpg') ?>" />
95
+ </td>
96
+ <td class="last">
97
+ <?php echo $this->__('Phone verification number is shown after your phone number is verified') ?>
98
+ </td>
99
+ </tr>
100
+ <tr>
101
+ <td>
102
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/phoneverf4.jpg') ?>" />
103
+ </td>
104
+ <td class="last">
105
+ <?php echo $this->__('Enter the phone verification number as shown') ?>
106
+ </td>
107
+ </tr>
108
+
109
+
110
+ </tbody>
111
+ </table>
112
+ </center>
113
+ </div>
114
+ </div>
115
+
116
+ <ul class="form-list">
117
+ <li>
118
+ <label for="ach-select" class="required"><em>*</em><?php echo $this->__('Account Type') ?></label>
119
+ <div class="input-box">
120
+ <select id="ach-select" name="payment[ach_accounttype]" class="required-entry">
121
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
122
+ <option value="PC">Checking</option>
123
+ <option value="PS">Saving</option>
124
+ </select>
125
+ </div>
126
+ </li>
127
+
128
+ <li>
129
+ <label for="ach-accountnumber" class="required">
130
+ <em>*</em><?php echo $this->__('Account Number') ?></label>
131
+ <span class="input-box">
132
+ <input type="text" class="required-entry validate-digits" maxlength="16" size="16" name="payment[ach_accountnumber]" />
133
+ </span><!-- required-entry validate-digits -->
134
+ </li>
135
+ <li>
136
+ <label for="ach-routingnumber" class="required">
137
+ <em>*</em><?php echo $this->__('Routing Number') ?></label>
138
+ <span class="input-box">
139
+ <input type="text" class="required-entry validate-digits" maxlength="11" size="11" name="payment[ach_routingnumber]" />
140
+ </span><!-- required-entry validate-digits -->
141
+ </li>
142
+ <li>
143
+ <label for="ach-checknumber" class="required">
144
+ <em>*</em><?php echo $this->__('Check Number') ?></label>
145
+ <span class="input-box">
146
+ <input type="text" class="required-entry validate-digits" maxlength="11" size="11" name="payment[ach_checknumber]" />
147
+ </span>
148
+ </li>
149
+ <li>
150
+ <div class="data-name" id="ach-ssn-field" style="display: none;" >
151
+ <label for="ach-ssn" class="required">
152
+ <em>*</em><?php echo $this->__('Last 4 digits of social secure number') ?></label>
153
+ <span class="input-box">
154
+ <input type="text" class="required-entry validate-digits validate-ach-ssn" maxLength="4" size="4" name="payment[ach_ssn]" />
155
+ </span>
156
+ </div>
157
+ </li>
158
+
159
+ <li>
160
+ <label for="ach-verf" class="required">
161
+ <em>*</em><?php echo $this->__('Phone Verification Form') ?></label>
162
+ <span class="input-box" style="width:380px;">
163
+
164
+ <a class="ach-make-tool ach-phone-verf-make-tool" title="<?php echo $this->__('How the signature box works') ?>" href="#">
165
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/qm.gif') ?>" alt="<?php echo $this->__('How phone verfication works') ?>" title="<?php echo $this->__('How phone verfication works') ?>" />
166
+ </a>
167
+
168
+ <iframe id="phoneVerificationBox" frameborder=0 style="margin:0px;width:360px;height:155px;float:left"
169
+ src="https://secure.2000charge.com/secure/PhoneVerification/PinCapture.asp?clientaccount=<?php echo $clientaccount ?>&key=<?php echo $keyaccount ?>&bgcolor=FBFAF6&fontcolor=666666&sms=1">
170
+ </iframe>
171
+ </span>
172
+ </li>
173
+ <li>
174
+ <label for="ach-phone-verf-num" class="required">
175
+ <em>*</em><?php echo $this->__('Phone Verification Number') ?></label>
176
+
177
+ <span class="input-box">
178
+ <input type="text" class="required-entry validate-digits validate-ach-phone-verf-num" maxlength="8" size="8" name="payment[ach_phone_verf_num]" />
179
+
180
+ </span>
181
+ </li>
182
+ </ul>
183
+
184
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/form/brazilpay.phtml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <ul class="form-list">
29
+ <li>
30
+ <label for="brazilpay-select" class="required">
31
+ <em>*</em><?php echo $this->__('BankCode') ?></label>
32
+
33
+ <div class="input-box">
34
+ <select id="brazilpay-select" name="payment[brazilpay_bankcode]" class="required-entry">
35
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
36
+ <option value="BB">Banco do Brasil</option>
37
+ <option value="I">Itau</option>
38
+ <option value="B3">Bradesco</option>
39
+ <option value="H">HSBC</option>
40
+ </select>
41
+ </div>
42
+ </li>
43
+ </ul>
44
+
45
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
46
+
47
+
48
+
49
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/form/directpaymax.phtml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php
29
+
30
+ $countryBankList = array( "DE" => array( "312" => "Augusta Bank",
31
+ "268" => "Deutsche Bank",
32
+ "299" => "Postbank",
33
+ "262" => "Raiffeisen-Volksbank",
34
+ ),
35
+ "US" => array( "1" => "Bank of America",
36
+ "6" => "Chase",
37
+ "2" => "CitiBank",
38
+ "320" => "Comerica Bank",
39
+ "321" => "U.S. Bank",
40
+ "9" => "Union Bank",
41
+ "3" => "Wells Fargo",
42
+ ),
43
+ );
44
+
45
+ $_cart = Mage::getModel('checkout/cart')->getQuote();
46
+ $countryCode = $_cart->getBillingAddress()->getCountry();
47
+
48
+ ?>
49
+ <ul class="form-list">
50
+ <li style="color:red">
51
+ <div > <?php echo $this->__('Please have your online bank user id and password ready') ?> </div>
52
+ </li>
53
+ <li>
54
+ <label for="directpaymax-bankcode" class="required"><em>*</em><?php echo $this->__('Select Bank') ?></label>
55
+ <div class="input-box">
56
+ <select id="directpaymax-select" name="payment[directpaymax_bankcode]" class="required-entry">
57
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
58
+ <?php foreach ($countryBankList as $countryObject => $countrykey) {
59
+ if ($countryObject == $countryCode ) {
60
+ foreach ($countrykey as $bankobject => $bankkey) { ?>
61
+ <option value="<?php echo $bankobject ?>"><?php echo $bankkey ?></option>
62
+ <?php }
63
+ }
64
+ } ?>
65
+ </select>
66
+ </div>
67
+ </li>
68
+ </ul>
69
+
70
+
71
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
72
+
73
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/form/eurodebit.phtml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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
+ ?>
30
+
31
+ <script type="text/javascript">
32
+
33
+ //<![CDATA[
34
+ var countryCode = '<?php echo $countryCode ?>';
35
+ if (countryCode == 'DE') {
36
+
37
+ Validation.add('validate-eurodebit-routingnumber-de', "<?php echo __('German Routing Number should be 8 digits') ?>", function (v) {
38
+
39
+ return Validation.get('IsEmpty').test(v) || /^(\d){8}$/.test(v)
40
+ });
41
+
42
+ }
43
+
44
+ //]]>
45
+ </script>
46
+
47
+ <ul class="form-list">
48
+ <li>
49
+ <label for="eurodebit-accountnumber" class="required"><em>*</em><?php echo $this->__('Account Number') ?></label>
50
+ <span class="input-box">
51
+ <input type="text" class="required-entry validate-digits" maxlength="16" size="16" name="payment[eurodebit_accountnumber]" />
52
+ </span>
53
+ </li>
54
+ <li>
55
+ <div class="data-name" id="eurodebit-routingnumber-field" style="display: none;" >
56
+ <label class="required" for="eurodebit-routingnumber"><em>*</em><?php echo $this->__('Routing Number') ?></label>
57
+ <span class="input-box">
58
+ <input type="text" class="required-entry validate-digits validate-eurodebit-routingnumber-de" maxlength="16" size="16" name="payment[eurodebit_routingnumber]" />
59
+ </span>
60
+ </div>
61
+ </li>
62
+ </ul>
63
+
64
+
app/design/frontend/base/default/template/alternativepayments/form/giropay.phtml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+
28
+
29
+ <script type="text/javascript">
30
+
31
+ //<![CDATA[
32
+ Validation.add('validate-giropay-routingnumber', "<?php echo __('Routing Number should be 8 digits') ?>", {
33
+ minLength : 8
34
+ });
35
+
36
+ //]]>
37
+ </script>
38
+
39
+ <ul class="form-list">
40
+ <li>
41
+ <label for="giropay-accountnumber" class="required"><em>*</em><?php echo $this->__('Account Number') ?></label>
42
+ <span class="input-box">
43
+ <input type="text" class="required-entry validate-digits" maxlength="16" size="16" name="payment[giropay_accountnumber]" />
44
+ </span>
45
+ </li>
46
+ <li>
47
+
48
+ <div class="data-name" id="giropay-routingnumber-field" style="display: none;" >
49
+ <label class="required" for="giropay-routingnumber"><em>*</em><?php echo $this->__('Routing Number') ?></label>
50
+ <span class="input-box">
51
+ <input type="text" class="required-entry validate-digits validate-giropay-routingnumber" maxlength="8" size="8" name="payment[giropay_routingnumber]" />
52
+ </span>
53
+ </div>
54
+ </li>
55
+ </ul>
56
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
57
+
app/design/frontend/base/default/template/alternativepayments/form/ideal.phtml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ ?>
27
+ <ul class="form-list">
28
+ <li>
29
+ <label for="ideal-select" class="required"><em>*</em><?php echo $this->__('BankCode') ?></label>
30
+ <div class="input-box">
31
+ <select id="ideal-select" name="payment[ideal_bankcode]" class="required-entry">
32
+ <option value="" selected="selected"><?php echo $this->__('Select Option') ?></option>
33
+ <option value="0031">0031 - ABN Amro Bank</option>
34
+ <option value="0761">0761 - ASN Bank</option>
35
+ <option value="0091">0091 - Friesland Bank</option>
36
+ <option value="0721">0721 - ING</option>
37
+ <option value="0021">0021 - Rabo Bank</option>
38
+ <option value="0751">0751 - SNS Bank</option>
39
+ <option value="0771">0771 - SNS Regio Bank</option>
40
+ <option value="0511">0511 - Triodos Bank</option>
41
+ </select>
42
+ </div>
43
+
44
+ </li>
45
+ </ul>
46
+ <?php echo $this->__('Proceed to SUBMIT ORDER for payment instructions') ?>
47
+
48
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/form/sepa.phtml ADDED
@@ -0,0 +1,810 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $clientaccount = Mage::getStoreConfig('payment/alternativepayments/clientaccount',Mage::app()->getStore());
28
+ $keyaccount = Mage::getStoreConfig('payment/alternativepayments/keyaccount',Mage::app()->getStore());
29
+
30
+ $cCode = Mage::getModel('checkout/cart')->getQuote()->getBillingAddress()->getCountry();
31
+
32
+ $dbIbanList = Mage::getModel('alternativepayments/dbiban')->getCollection()->getData();
33
+ $count = count($dbIbanList);
34
+
35
+ ?>
36
+
37
+
38
+ <script type="text/javascript">
39
+
40
+ //<![CDATA[
41
+
42
+ //var test = '<?php // echo $cCode ?>';
43
+ // console.log(test);
44
+ // console.log("-------start !!-----------");
45
+
46
+
47
+ var name = '';
48
+ var code = '';
49
+ var bank = '';
50
+ var acc = '';
51
+ var bank_lng = '';
52
+ var acc_lng = '';
53
+ var total_lng = '';
54
+
55
+ var iban_data = new Array();
56
+ // create array iban_data in db
57
+ <?php for ($i = 0; $i < $count; ++$i) { ?>
58
+
59
+ iban_data.push(new Country("<?php echo $dbIbanList[$i]['country'] ?>",
60
+ "<?php echo $dbIbanList[$i]['country_id'] ?>",
61
+ "<?php echo $dbIbanList[$i]['bank_code'] ?>",
62
+ "<?php echo $dbIbanList[$i]['account_number'] ?>"
63
+ )
64
+ );
65
+ <?php } ?>
66
+ // check if iban is valid
67
+ jQuery('input[name="payment[sepa_iban]"]').change(function () {
68
+
69
+ var ibanCheckResult = CheckIBAN(jQuery('input[name="payment[sepa_iban]"]').val() );
70
+
71
+ // console.log(ibanCheckResult);
72
+
73
+ if (ibanCheckResult == "OK") {
74
+ jQuery('input[name="payment[sepa_iban_hidden]"]').val(ibanCheckResult)
75
+ } else {
76
+ jQuery('input[name="payment[sepa_iban_hidden]"]').val(ibanCheckResult)
77
+ }
78
+ });
79
+
80
+ // show popup window with info - Signature
81
+ function toggleSignatureToolTip(event){
82
+ if($('signature-make-tool-tip')){
83
+ $('signature-make-tool-tip').setStyle({
84
+ top: (Event.pointerY(event)-560)+'px'//,
85
+ //left: (Event.pointerX(event)+100)+'px'
86
+ })
87
+ $('signature-make-tool-tip').toggle();
88
+ }
89
+ Event.stop(event);
90
+ }
91
+ if($('signature-make-tool-tip-close')){
92
+ Event.observe($('signature-make-tool-tip-close'), 'click', toggleSignatureToolTip);
93
+ }
94
+
95
+ $$('.sepa-signature-make-tool').each(function(element){
96
+ Event.observe(element, 'click', toggleSignatureToolTip);
97
+ });
98
+
99
+ // show popup window with info - Signature Number
100
+ function toggleSignatureNumberToolTip(event){
101
+ if($('signature-number-make-tool-tip')){
102
+ $('signature-number-make-tool-tip').setStyle({
103
+ top: (Event.pointerY(event)-560)+'px'//,
104
+ //left: (Event.pointerX(event)+100)+'px'
105
+ })
106
+ $('signature-number-make-tool-tip').toggle();
107
+ }
108
+ Event.stop(event);
109
+ }
110
+ if($('signature-number-make-tool-tip-close')){
111
+ Event.observe($('signature-number-make-tool-tip-close'), 'click', toggleSignatureNumberToolTip);
112
+ }
113
+
114
+ $$('.sepa-signature-number-make-tool').each(function(element){
115
+ Event.observe(element, 'click', toggleSignatureNumberToolTip);
116
+ });
117
+
118
+ // show popup window with info - Bic
119
+ function toggleBicToolTip(event){
120
+ if($('bic-make-tool-tip')){
121
+ $('bic-make-tool-tip').setStyle({
122
+ top: (Event.pointerY(event)-560)+'px'//,
123
+ //left: (Event.pointerX(event)+100)+'px'
124
+ })
125
+ $('bic-make-tool-tip').toggle();
126
+ }
127
+ Event.stop(event);
128
+ }
129
+ if($('bic-make-tool-tip-close')){
130
+ Event.observe($('bic-make-tool-tip-close'), 'click', toggleBicToolTip);
131
+ }
132
+
133
+
134
+ $$('.sepa-bic-make-tool').each(function(element){
135
+ Event.observe(element, 'click', toggleBicToolTip);
136
+ });
137
+
138
+ // show popup window with info - Iban
139
+ function toggleIbanToolTip(event){
140
+ if($('iban-make-tool-tip')){
141
+ $('iban-make-tool-tip').setStyle({
142
+ top: (Event.pointerY(event)-560)+'px'//,
143
+ //left: (Event.pointerX(event)+100)+'px'
144
+ })
145
+ $('iban-make-tool-tip').toggle();
146
+ }
147
+ Event.stop(event);
148
+ }
149
+ if($('iban-make-tool-tip-close')){
150
+ Event.observe($('iban-make-tool-tip-close'), 'click', toggleIbanToolTip);
151
+ }
152
+
153
+
154
+ $$('.sepa-iban-make-tool').each(function(element){
155
+ Event.observe(element, 'click', toggleIbanToolTip);
156
+ });
157
+
158
+
159
+
160
+ $$('#iban-button').each(function(element){
161
+ // console.log('attaching event handler');
162
+ Event.observe(element, 'click', submitIBAN);
163
+ });
164
+
165
+ // $$('.button').each(function(elmt) {
166
+ // elmt.observe('click', function(ev) {
167
+ // ev.target.disabled='disabled';
168
+ // });
169
+ // });
170
+
171
+
172
+ function submitIBAN() {
173
+
174
+ console.log('submitIBAN');
175
+
176
+ var xccode = '<?php echo $cCode ?>';
177
+
178
+ var xbankcode = $('xbankcode').value;
179
+ var xaccountnumber = $('xaccountnumber').value;
180
+
181
+ var ibanResult = false;
182
+
183
+ ibanResult = contructIBAN();
184
+ ibanCheckResult = CheckIBAN( jQuery('input[name="payment[sepa_iban]"]').val() );
185
+ // console.log(ibanResult);
186
+ if (ibanResult) {
187
+ jQuery('input[name="payment[sepa_iban_hidden]"]').val('OK')
188
+ $('iban-make-tool-tip').hide();
189
+ } else {
190
+ jQuery('input[name="payment[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
+ var numcharlistbank = addCodeDescription(charlistbank, 'xbankcode');
278
+ var numcharlistacc = addCodeDescription(charlistacc, 'xaccountnumber');
279
+ var nnn = numcharlistbank + numcharlistacc;
280
+ jQuery('input[name="payment[sepa_iban]"]').attr('maxlength', numcharlistbank+numcharlistacc+4);
281
+ jQuery('input[name="payment[sepa_iban]"]').attr('size', numcharlistbank+numcharlistacc+10);
282
+
283
+ }
284
+ // add info description
285
+ function addIbanInfoDescription(charflag) {
286
+
287
+ jQuery("div#iban-info-description").empty();
288
+ for (var i = 0; i < charflag.length; ++i) {
289
+ if (charflag[i] == 'a') {
290
+ jQuery("div#iban-info-description").append(' &nbsp;&nbsp;<b>a</b>: <?php echo $this->__('letters A-Z') ?> ');
291
+ } else if (charflag[i] == 'n') {
292
+ jQuery("div#iban-info-description").append(' &nbsp;&nbsp;<b>n</b>: <?php echo $this->__('numbers 0-9') ?> ');
293
+ } else if (charflag[i] == 'c') {
294
+ jQuery("div#iban-info-description").append(' &nbsp;&nbsp;<b>c</b>: <?php echo $this->__('letters A-Z and numbers 0-9') ?> ');
295
+ }
296
+ }
297
+ }
298
+
299
+ // add description on filed Bank/Branch and account Number field (ex: (Format: 4a + 6n))
300
+ // charlist: list of characters for print
301
+ // identifier: html id, where jquery insert description
302
+ function addCodeDescription(charlist, identifier) {
303
+
304
+ jQuery("div#"+identifier+"-description").empty();
305
+ var msg = "";
306
+ var numChar = 0;
307
+ for (var i = 0; i < charlist.length; ++i) {
308
+ msg = msg + charlist[i][0] + charlist[i][1];
309
+ numChar = numChar + charlist[i][0];
310
+ if (i != (charlist.length-1) ) {
311
+ msg = msg + ' + ';
312
+ }
313
+ }
314
+ jQuery("div#"+identifier+"-description").append(' (<?php echo $this->__('Format') ?>: '+msg+')');
315
+ jQuery("input#"+identifier).attr('size', numChar+4);
316
+ jQuery("input#"+identifier).attr('maxlength', numChar);
317
+
318
+ return numChar;
319
+ }
320
+
321
+ // Search the country code in the iban_data list.
322
+ function CountryData(code)
323
+ {
324
+ for (var i = 0; i < iban_data.length; ++i)
325
+ if (iban_data[i].code == code)
326
+ return iban_data[i];
327
+ return null;
328
+ }
329
+
330
+ // Modulo 97 for huge numbers given as digit strings.
331
+ function mod97(digit_string)
332
+ {
333
+ var m = 0;
334
+ for (var i = 0; i < digit_string.length; ++i)
335
+ m = (m * 10 + parseInt(digit_string.charAt(i))) % 97;
336
+ return m;
337
+ }
338
+
339
+ // Convert a capital letter into digits: A -> 10 ... Z -> 35 (ISO 13616).
340
+ function capital2digits(ch)
341
+ {
342
+ var capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
343
+ for (var i = 0; i < capitals.length; ++i)
344
+ if (ch == capitals.charAt(i))
345
+ break;
346
+ return i + 10;
347
+ }
348
+
349
+ // Fill the string with leading zeros until length is reached.
350
+ function fill0(s, l)
351
+ {
352
+ while (s.length < l)
353
+ s = "0" + s;
354
+ return s;
355
+ }
356
+
357
+ // Compare two strings respecting german umlauts.
358
+ function strcmp(s1, s2)
359
+ {
360
+ var chars = "AaÄäBbCcDdEeFfGgHhIiJjKkLlMmNnOoÖöPpQqRrSsßTtUuÜüVvWwXxYyZz";
361
+ var lng = (s1.length < s2.length) ? s1.length : s2.length;
362
+ for (var i = 0; i < lng; ++i)
363
+ {
364
+ var d = chars.indexOf(s1.charAt(i)) - chars.indexOf(s2.charAt(i));
365
+ if (d != 0)
366
+ return d;
367
+ }
368
+ return s1.length - s2.length;
369
+ }
370
+
371
+ // Create an index table of the iban_data list sorted by country names.
372
+ function CountryIndexTable()
373
+ {
374
+ var tab = new Array();
375
+ var i, j, t;
376
+ for (i = 0; i < iban_data.length; ++i)
377
+ tab[i] = i;
378
+ for (i = tab.length - 1; i > 0; --i)
379
+ for (j = 0; j < i; ++j)
380
+ if (strcmp(iban_data[tab[j]].name, iban_data[tab[j+1]].name) > 0)
381
+ t = tab[j], tab[j] = tab[j+1], tab[j+1] = t;
382
+ return tab;
383
+ }
384
+
385
+ // Calculate 2-digit checksum of an IBAN.
386
+ function ChecksumIBAN(iban)
387
+ {
388
+ var code = iban.substring(0, 2);
389
+ var checksum = iban.substring(2, 4);
390
+ var bban = iban.substring(4);
391
+
392
+ // Assemble digit string
393
+ var digits = "";
394
+ for (var i = 0; i < bban.length; ++i)
395
+ {
396
+ var ch = bban.charAt(i).toUpperCase();
397
+ if ("0" <= ch && ch <= "9")
398
+ digits += ch;
399
+ else
400
+ digits += capital2digits(ch);
401
+ }
402
+ for (var i = 0; i < code.length; ++i)
403
+ {
404
+ var ch = code.charAt(i);
405
+ digits += capital2digits(ch);
406
+ }
407
+ digits += checksum;
408
+
409
+ // Calculate checksum
410
+ checksum = 98 - mod97(digits);
411
+ return fill0("" + checksum, 2);
412
+ }
413
+
414
+ // Fill the account number part of IBAN with leading zeros.
415
+ function FillAccount(country, account)
416
+ {
417
+ return fill0(account, country.acc_lng);
418
+ }
419
+
420
+ // Check if syntax of the part of IBAN is invalid.
421
+ function InvalidPart(form_list, iban_part)
422
+ {
423
+ for (var f = 0; f < form_list.length; ++f)
424
+ {
425
+ var lng = form_list[f][0], typ = form_list[f][1];
426
+ if (lng > iban_part.length)
427
+ lng = iban_part.length;
428
+ for (var i = 0; i < lng; ++i)
429
+ {
430
+ var ch = iban_part.charAt(i);
431
+ var a = ("A" <= ch && ch <= "Z");
432
+ var n = ("0" <= ch && ch <= "9");
433
+ var c = n || a || ("a" <= ch && ch <= "z");
434
+ if ((!c && typ == "c") || (!a && typ == "a") || (!n && typ == "n"))
435
+ return true;
436
+ }
437
+ iban_part = iban_part.substring(lng);
438
+ }
439
+ return false;
440
+ }
441
+
442
+ // Check if length of the bank/branch code part of IBAN is invalid.
443
+ function InvalidBankLength(country, bank)
444
+ {
445
+ return (bank.length != country.bank_lng);
446
+ }
447
+
448
+ // Check if syntax of the bank/branch code part of IBAN is invalid.
449
+ function InvalidBank(country, bank)
450
+ {
451
+ return (InvalidBankLength(country, bank) ||
452
+ InvalidPart(country.bank, bank));
453
+ }
454
+
455
+ // Check if length of the account number part of IBAN is invalid.
456
+ function InvalidAccountLength(country, account)
457
+ {
458
+ return (account.length < 1 || account.length > country.acc_lng);
459
+ }
460
+
461
+ // Check if syntax of the account number part of IBAN is invalid.
462
+ function InvalidAccount(country, account)
463
+ {
464
+ return (InvalidAccountLength(country, account) ||
465
+ InvalidPart(country.acc, FillAccount(country, account)));
466
+ }
467
+
468
+ // Check if length of IBAN is invalid.
469
+ function InvalidIBANlength(country, iban)
470
+ {
471
+ return (iban.length != country.total_lng);
472
+ }
473
+
474
+ // Convert iban from intern value to string format (IBAN XXXX XXXX ...).
475
+ function extern(intern)
476
+ {
477
+ var s = "IBAN";
478
+ for (var i = 0; i < intern.length; ++i)
479
+ {
480
+ if (i % 4 == 0)
481
+ s += " ";
482
+ s += intern.charAt(i);
483
+ }
484
+ return s;
485
+ }
486
+
487
+ // Convert iban from string format to intern value.
488
+ function intern(extern)
489
+ {
490
+ if (extern.substring(0, 4) == "IBAN")
491
+ extern = extern.substring(4);
492
+ var s = "";
493
+ for (var i = 0; i < extern.length; ++i)
494
+ if (extern.charAt(i) != " ")
495
+ s += extern.charAt(i);
496
+ return s;
497
+ }
498
+
499
+ // Calculate the checksum and assemble the IBAN.
500
+ function CalcIBAN(country, bank, account)
501
+ {
502
+ var fill_acc = FillAccount(country, account);
503
+ var checksum = ChecksumIBAN(country.code + "00" + bank + fill_acc);
504
+ return country.code + checksum + bank + fill_acc;
505
+ }
506
+
507
+ function CalcAltIBAN(country, bank, account)
508
+ {
509
+ var fill_acc = FillAccount(country, account);
510
+ var checksum = ChecksumIBAN(country.code + "00" + bank + fill_acc);
511
+ checksum = fill0("" + mod97(checksum), 2);
512
+ return country.code + checksum + bank + fill_acc;
513
+ }
514
+
515
+ // Check the checksum of an IBAN.
516
+ function IBANokay(iban)
517
+ {
518
+ return ChecksumIBAN(iban) == "97";
519
+ }
520
+
521
+ // Check the input, calculate the checksum and assemble the IBAN.
522
+ function CreateIBAN()
523
+ {
524
+
525
+ var code = "<?php echo $cCode; ?>";
526
+ var bank = $('xbankcode').value; // intern(form.bankcode.value);
527
+ var account = $('xaccountnumber').value; // intern(form.accountnumber.value);
528
+ var country = CountryData(code);
529
+
530
+ var err = null, err_focus = null;
531
+ if (country == null)
532
+ {
533
+ err = "<?php echo __('Unknown Country Code') ?>: " + code;
534
+ //err_focus = form.country;
535
+
536
+ }
537
+ else if (InvalidBankLength(country, bank))
538
+ {
539
+ err = "<?php echo __('Bank/Branch Code length') ?> " + bank.length +
540
+ " <?php echo __('is not correct for') ?> " + country.name +
541
+ " (" + country.bank_lng + ")";
542
+ // err_focus = form.bank;
543
+ }
544
+ else if (InvalidBank(country, bank))
545
+ {
546
+ err = "<?php echo __('Bank/Branch Code') ?> " + bank + " <?php echo __('is not correct for') ?> " +
547
+ country.name;
548
+ // err_focus = form.bank;
549
+ }
550
+ else if (InvalidAccountLength(country, account))
551
+ {
552
+ err = "<?php echo __('Account Number length') ?> " + account.length +
553
+ " <?php echo __('is not correct for') ?> " + country.name +
554
+ " (" + country.acc_lng + ")";
555
+ // err_focus = form.account;
556
+ }
557
+ else if (InvalidAccount(country, account))
558
+ {
559
+ err = "<?php echo __('Account Number') ?> " + account + " <?php echo __('is not correct for') ?> " +
560
+ country.name;
561
+ // err_focus = form.account;
562
+ }
563
+ if (err)
564
+ {
565
+ alert(err);
566
+ return "error";
567
+ }
568
+ else
569
+ {
570
+ return CalcIBAN(country, bank, account);
571
+ }
572
+ }
573
+
574
+ // Check the syntax and the checksum of the IBAN.
575
+ function CheckIBAN(iBanNumber)
576
+ {
577
+ var iban = intern(iBanNumber);
578
+
579
+ var code = iban.substring(0, 2);
580
+ var checksum = iban.substring(2, 4);
581
+ var bban = iban.substring(4);
582
+ var country = CountryData(code);
583
+
584
+ var err = null;
585
+ if (country == null)
586
+ err = "<?php echo __('Unknown Country Code') ?>: " + code;
587
+ else if (InvalidIBANlength(country, iban))
588
+ err = "<?php echo __('IBAN length') ?> " + iban.length + " <?php echo __('is not correct for') ?> " +
589
+ country.name + " (" + country.total_lng + ")";
590
+ else
591
+ {
592
+ var bank_lng = country.bank_lng;
593
+ var bank = bban.substring(0, bank_lng);
594
+ var account = bban.substring(bank_lng);
595
+
596
+ if (InvalidBank(country, bank))
597
+ err = "<?php echo __('Bank/Branch Code') ?> " + bank + " <?php echo __('is not correct for') ?> " +
598
+ country.name;
599
+ else if (InvalidAccount(country, account))
600
+ err = "<?php echo __('Account Number') ?> " + account + " <?php echo __('is not correct for') ?> " +
601
+ country.name;
602
+ else if (!IBANokay(iban))
603
+ err = "<?php echo __('Checksum of IBAN incorrect') ?>";
604
+ }
605
+
606
+ if (err)
607
+ {
608
+ return err;
609
+ }
610
+ else
611
+ {
612
+ return "OK";
613
+ }
614
+ }
615
+
616
+ // Translation table and translation function for localized versions
617
+ var trans_tab = new Array();
618
+
619
+ function _(s)
620
+ {
621
+ var t = trans_tab[s];
622
+ if (t)
623
+ s = t;
624
+ return s;
625
+ }
626
+
627
+ function contructIBAN() {
628
+ var ibanCreateResult = CreateIBAN();
629
+ if (ibanCreateResult == "error") {
630
+ return false;
631
+ }
632
+ else {
633
+ // document.capture.ibancomp.value = ibanCreateResult;
634
+ jQuery('input[name="payment[sepa_iban]"]').val(ibanCreateResult);
635
+ return true;
636
+ }
637
+ }
638
+
639
+ Validation.add('validate-sepa-bic', '<?php echo __('BIC/SWIFT must have 8 or 11 characters') ?>', function (v) {
640
+ return Validation.get('IsEmpty').test(v) || /^([a-zA-Z0-9]{8}([a-zA-Z0-9]{3})?)?$/.test(v)
641
+ });
642
+
643
+ Validation.add('validate-sepa-signature', '<?php echo __('Signature number must have 8 digits') ?>', {
644
+ minLength : 8
645
+ });
646
+
647
+ //]]>
648
+ </script>
649
+
650
+
651
+ <div class="tool-tip" id="signature-make-tool-tip" style="display:none;">
652
+ <div class="btn-close"><a href="#" id="signature-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
653
+ <div class="tool-tip-content">
654
+ <!-- <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') ?>" /> -->
655
+
656
+ <strong><?php echo __('How Signature box works') ?></strong>
657
+ <br><br>
658
+ <?php echo __('Click and hold down the left mouse button inside') ?><br>
659
+ <?php echo __('the signature pad box below and script your name.') ?><br><br>
660
+ <?php echo __('As part of your rights, you are entitled to a refund from') ?><br>
661
+ <?php echo __('your bank under the terms and conditions of your') ?><br>
662
+ <?php echo __('agreement with your bank. A refund must be claimed') ?><br>
663
+ <?php echo __('within 8 weeks starting from the date on which') ?> <br>
664
+ <?php echo __('your account was debited. Your rights are explained') ?><br>
665
+ <?php echo __('in a statement that you can obtain from your bank.') ?>
666
+ </div>
667
+ </div>
668
+
669
+ <div class="tool-tip" id="signature-number-make-tool-tip" style="display:none;">
670
+ <div class="btn-close"><a href="#" id="signature-number-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
671
+ <div class="tool-tip-content">
672
+ <!-- <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') ?>" /> -->
673
+
674
+ <strong><?php echo __('Signature number') ?></strong>
675
+ <br><br>
676
+ <?php echo __('Please enter signature number shown') ?> <br>
677
+ <?php echo __('when you confirm the signature above.') ?>
678
+
679
+ </div>
680
+ </div>
681
+
682
+ <div class="tool-tip" id="iban-make-tool-tip" style="display:none;">
683
+ <div class="btn-close"><a href="#" id="iban-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
684
+ <div class="tool-tip-content">
685
+ <strong><?php echo __('IBAN - International Bank Account Number') ?></strong>
686
+ <br>
687
+ <br>
688
+ <?php echo __('Please enter the following information to compose your IBAN') ?>
689
+ <br>
690
+ <br>
691
+ <table>
692
+ <tbody>
693
+ <tr>
694
+ <td align="left"><?php echo $this->__('Bank/Branch Code') ?>:</td>
695
+ <td align="left"><input maxlength="10" size="18" name="xbankcode" id="xbankcode">
696
+ <div id="xbankcode-description" style="display: inline;">
697
+ </div>
698
+ </td>
699
+ </tr>
700
+ <tr>
701
+ <td align="left"><?php echo $this->__('Account Number') ?>:</td>
702
+ <td align="left"><input maxlength="8" size="18" name="xaccountnumber" id="xaccountnumber">
703
+ <div id="xaccountnumber-description" style="display: inline;">
704
+ </div>
705
+ </td>
706
+ </tr>
707
+
708
+ <tr>
709
+ <td colspan="2"><br></td>
710
+ </tr>
711
+ <tr>
712
+ <td align="left" colspan="2">
713
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/information.png') ?>" alt="<?php echo $this->__('Information') ?>" title="<?php echo $this->__('Information') ?>" />
714
+ <div id="iban-info-description" style="display: inline;">
715
+
716
+ </div>
717
+ </td>
718
+ </tr>
719
+ <tr>
720
+ <td colspan="2"><br>
721
+ </td>
722
+ </tr>
723
+ <tr>
724
+ <td colspan="2" align="center">
725
+ <center><button type="button" id="iban-button">
726
+ <span>
727
+ <span>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->__('Submit') ?>&nbsp;&nbsp;&nbsp;&nbsp;</span>
728
+ </span>
729
+ </button>
730
+
731
+ </center>
732
+
733
+ </td>
734
+ </tr>
735
+ </tbody>
736
+ </table>
737
+ </div>
738
+ </div>
739
+
740
+ <div class="tool-tip" id="bic-make-tool-tip" style="display:none;">
741
+ <div class="btn-close"><a href="#" id="bic-make-tool-tip-close" title="<?php echo $this->__('Close') ?>"><?php echo $this->__('Close') ?></a></div>
742
+ <div class="tool-tip-content">
743
+ <strong><?php echo $this->__('BIC/SWIFT Code - Business Identifier Codes') ?></strong>
744
+ <br><br>
745
+ <center>
746
+ <table>
747
+ <tbody>
748
+ <tr>
749
+ <td align="left" width="280px">
750
+ <?php echo $this->__('SWIFT codes are most commonly used for international wire transfers and are') ?>
751
+ <?php echo $this->__('comprised of 8 or 11 alphanumeric characters.') ?>
752
+ <?php echo $this->__('Please contact your bank if you do not know your BIC/SWIFT code.') ?>
753
+ </td>
754
+ </tr>
755
+ </tbody>
756
+ </table>
757
+ </center>
758
+ </div>
759
+ </div>
760
+
761
+ <ul class="form-list">
762
+ <li>
763
+ <label for="sepa-iban" class="required">
764
+ <em>*</em><?php echo $this->__('IBAN') ?></label>
765
+ <span class="input-box" style="width:310px;">
766
+ <a class="sepa-make-tool sepa-iban-make-tool" title="<?php echo $this->__('What is IBAN code') ?>" href="#">
767
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/qm.gif') ?>" alt="<?php echo $this->__('What is IBAN code') ?>" title="<?php echo $this->__('What is IBAN code') ?>" />
768
+ </a>
769
+ <input type="text" style="float:left" class="required-entry validate-alphanum" maxlength="3" size="3" name="payment[sepa_iban]" />
770
+ <input type="hidden" style="float:left" name="payment[sepa_iban_hidden]" />
771
+ </span>
772
+ </li>
773
+ <li>
774
+ <label for="sepa-bic" class="required">
775
+ <em>*</em><?php echo $this->__('BIC/SWIFT') ?></label>
776
+ <span class="input-box">
777
+ <a class="sepa-make-tool sepa-bic-make-tool" title="<?php echo $this->__('What is BIC/SWIFT code') ?>" href="#">
778
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/qm.gif') ?>" alt="<?php echo $this->__('What is BIC/SWIFT code') ?>" title="<?php echo $this->__('What is BIC/SWIFT code') ?>" />
779
+ </a>
780
+ <input type="text" style="float:left" class="required-entry validate-alphanum validate-sepa-bic" maxlength="11" size="15" name="payment[sepa_bic]" />
781
+ </span>
782
+ </li>
783
+
784
+ <li>
785
+ <label for="sepa-signature" class="required">
786
+ <em>*</em><?php echo $this->__('Signature') ?></label>
787
+ <span class="input-box" style="width:360px;">
788
+ <a class="sepa-make-tool sepa-signature-make-tool" title="<?php echo $this->__('How the signature box works') ?>" href="#">
789
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/qm.gif') ?>" alt="<?php echo $this->__('How the signature box works') ?>" title="<?php echo $this->__('How the signature box works') ?>" />
790
+ </a>
791
+ <iframe id="signaturebox" frameborder=0 style="margin:0px;width:325px;height:145px;float:left"
792
+ src="https://secure.2000charge.com/secure/signature/capturesignature.asp?clientaccount=<?php echo $clientaccount ?>&key=<?php echo $keyaccount ?>">
793
+ </iframe>
794
+ </span>
795
+ </li>
796
+ <li>
797
+ <label for="sepa-signature-number" class="required">
798
+ <em>*</em><?php echo $this->__('Signature number') ?></label>
799
+ <span class="input-box">
800
+ <!-- <input type="text" class="required-entry" maxlength="11" size="11" name="payment[sepa_bic]" /> -->
801
+ <a class="sepa-make-tool sepa-signature-number-make-tool" title="<?php echo $this->__('How you make Signature Number') ?>" href="#">
802
+ <img src="<?php echo $this->getSkinUrl('alternativepayments/images/qm.gif') ?>" alt="<?php echo $this->__('How you make Signature Number') ?>" title="<?php echo $this->__('How you make Signature Number') ?>" />
803
+ </a>
804
+ <input type="text" style="float:left" class="required-entry validate-digits validate-sepa-signature" id="signum" maxLength="8" size="8" name="payment[sepa_signum]">
805
+
806
+ </span>
807
+ </li>
808
+ </ul>
809
+
810
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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('alternativepayments/session')->getYYY());
37
+
38
+ //endif;
39
+ ?>
40
+
41
+ <?php // echo $value2; ?>
42
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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('alternativepayments/index/success'));
99
+
100
+ }
101
+
102
+ Mage::getSingleton('checkout/session')->unsQuoteId();
103
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('alternativepayments/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('alternativepayments/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/alternativepayments/redirect.phtml ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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
+ } elseif ($_SERVER['REQUEST_METHOD'] == "GET" && isset($_GET["transactionNumber"]) ) {
73
+
74
+ $validated = $_GET['status'];
75
+
76
+ if ($_GET['account'] == $_GET['pricepoint']) {
77
+
78
+ if ( $_GET['error'] == "" && $validated == "APPROVED")
79
+ {
80
+
81
+ $orderId = $_GET["passthru"];
82
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
83
+
84
+ // Mage::log(var_export($order->debug(), TRUE), null,'$orderOBJ_get_postback.log');
85
+
86
+ if ($order->getState() == "new") {
87
+
88
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
89
+ $order->setStatus('processing_paid');
90
+ $order->sendNewOrderEmail();
91
+ $order->setEmailSent(true);
92
+ $order->save();
93
+
94
+ Mage::getSingleton('checkout/session')->unsQuoteId();
95
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('alternativepayments/index/success'));
96
+
97
+ }
98
+
99
+ Mage::getSingleton('checkout/session')->unsQuoteId();
100
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('alternativepayments/index/isapprove'));
101
+
102
+ } else if ($_GET['error'] != "" && $validated == "DECLINED") {
103
+
104
+ $err_msg = $_GET['error'];
105
+ $orderId = $_GET["passthru"];
106
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
107
+
108
+ $order->cancel()->setState(Mage_Sales_Model_Order::STATE_CANCELED, true, "Gateway has declined the payment. Error: $err_msg")->save();
109
+
110
+ Mage::getSingleton('checkout/session')->unsQuoteId();
111
+
112
+ return Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('alternativepayments/index/failure'));
113
+
114
+ }
115
+ }
116
+ else
117
+ Mage_Core_Controller_Varien_Action::_redirect('../..');
118
+ }
119
+
120
+ ?>
121
+
122
+
123
+
124
+
125
+
app/design/frontend/base/default/template/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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('alternativepayments/session')->getYYY();
31
+ $value2 = unserialize(Mage::getSingleton('alternativepayments/session')->getPostBack());
32
+ $val2 = unserialize(Mage::getSingleton('alternativepayments/session')->getBackFlag());
33
+ //endif;
34
+ if ($val2 == 'TRUE') {
35
+ echo $this->__('Redirect to payment service...');
36
+ $val2 = unserialize(Mage::getSingleton('alternativepayments/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/alternativepayments/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 base_default
23
+ * @copyright Copyright (c) 2012 Alternative Payments Inc (http://www.alternativepayments.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/AlternativePaymentsInc_AlternativePayments.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <AlternativePaymentsInc_AlternativePayments>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </AlternativePaymentsInc_AlternativePayments>
8
+ </modules>
9
+ </config>
app/locale/en_US/AlternativePaymentsInc_AlternativePayments.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>AlternativePaymentsInc_AlternativePayments</name>
4
+ <version>1.0.0</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>The number of different payment options worldwide can be confusing and just keeping track of all of them can be tedious work. Alternative Payments provide merchants with simple and easy to use solutions taking the complexity out of the process. </summary>
10
+ <description>An Alternative payment is a payment method other than the usage of the traditional credit card. Alternative payments are just as popular as credit card payments. However, not everyone has a credit card or likes to use them online. Especially outside the United States, credit card coverage is as low as 10% and is certainly not a widespread payment method.&#xD;
11
+ Alternative Payments offers merchants a variety of payment methods that will limit the exposure and risks involved in providing services online to consumers worldwide.&#xD;
12
+ Adding Alternative Payments extension will increase your sales because you can offer consumers more options to pay:&#xD;
13
+ ACH - Online Check&#xD;
14
+ BARPAY&#xD;
15
+ EPS&#xD;
16
+ iDEAL&#xD;
17
+ GiroPay&#xD;
18
+ YellowPay&#xD;
19
+ EuroDebit&#xD;
20
+ Pay by Bank&#xD;
21
+ Directpay&#xD;
22
+ Paysafecard&#xD;
23
+ POLi&#xD;
24
+ Przelewy24&#xD;
25
+ Teleingreso&#xD;
26
+ EuroDebit SEPA&#xD;
27
+ QIWI</description>
28
+ <notes>This module adds the wide range of different alternative payment methods.</notes>
29
+ <authors><author><name>Alternative Payments Inc</name><user>altpayments</user><email>magento@alternativepayments.com</email></author></authors>
30
+ <date>2013-01-30</date>
31
+ <time>16:52:19</time>
32
+ <contents><target name="magecommunity"><dir name="AlternativePaymentsInc"><dir name="AlternativePayments"><dir name="Block"><file name="Form.php" hash="7872bc7c6373e95cd6baa62308c761e8"/><file name="PaymentInfo.php" hash="f9fd55ba85bf393b477e8349ce111189"/><file name="Postback.php" hash="d86610d918c9ef273f8881daa4daa1b2"/><file name="Redirect.php" hash="6da455eed980c9cc81dc6faba3fb07c5"/></dir><dir name="Helper"><file name="Data.php" hash="a34b1fde4d3fd9f7fe3c1c9cd466735a"/></dir><dir name="Model"><file name="Dbiban.php" hash="77570789806b0777dd080aff5297b36f"/><file name="Dbsource.php" hash="0901fcf408b616e3dece942c36466ebd"/><dir name="Mysql4"><dir name="Dbiban"><file name="Collection.php" hash="3308f64b6eb00f45f11f14f15e6bd455"/></dir><file name="Dbiban.php" hash="27488a50bffc0283cf7d9ca7bf1100f9"/><dir name="Dbsource"><file name="Collection.php" hash="cf58c8f838e9a60bc9df251fa79813ce"/></dir><file name="Dbsource.php" hash="cb7421422905d1b71aab74bc6a0657c6"/></dir><dir name="Resource"><file name="Setup.php" hash="c895acc6ccdd12f3f1dc656fa0075c9a"/></dir><file name="Session.php" hash="935ad9754dd2be70455bb77dde200056"/><file name="Standard.php" hash="042c27a5b8a117230b40438f81c29108"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Allowtypeall.php" hash="5e8a9672c445a9ea959863d10bf01581"/><dir name="Payment"><file name="Alternativepaymenttype.php" hash="f46c88e5b2185f11a4c97ea7b9e65d34"/></dir><file name="Testmode.php" hash="ea23e270155e949398963977a3281bf4"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="3f140638fb6a07b14594783784fff77a"/><file name="PaymentController.php" hash="762ba0744fd3c4f5ee4bfa85033f27eb"/></dir><dir name="etc"><file name="config.xml" hash="33925bb32fcf0c123099b026ed645652"/><file name="system.xml" hash="f84e221f59eead52b622ac0607c74fec"/></dir><dir name="sql"><dir name="alternativepayments_setup"><file name="mysql4-install-0.1.0.php" hash="ed0e8022c9fe3a399b32056c658ba062"/><file name="mysql4-upgrade-0.1.0-0.1.4.php" hash="d29e5b80d189e99601ef34de81297067"/><file name="mysql4-upgrade-0.1.4-0.2.0.php" hash="67731c22b9017e2988e037f5f2a6ec09"/><file name="mysql4-upgrade-0.2.0-0.2.2.php" hash="28e1ed22715f799d2ae785d12553ba34"/><file name="mysql4-upgrade-0.2.2-0.2.3.php" hash="abdbc6f83b11e61ee5879d48f8499fc2"/><file name="mysql4-upgrade-0.2.3-1.0.0.php" hash="f3496138737318ea3cbe817c0036f8ff"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="AlternativePaymentsInc_AlternativePayments.xml" hash="c95eef35957a05ed40dbc8f038432c6a"/></dir></target><target name="magelocale"><dir name="en_US"><file name="AlternativePaymentsInc_AlternativePayments.csv" hash="8ddcaf54ac93ec7b5af8b5f9c4df350a"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="alternativepayments"><file name="failure.phtml" hash="9a6181d271abaa1250857a8f26394afe"/><dir name="form"><file name="ach.phtml" hash="3ab3dce8e907f6a26a58e2fc74010c7f"/><file name="barpay.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="brazilpay.phtml" hash="1ebcedd34b5bb07188a928f748172846"/><file name="chinadebit.phtml" hash="56bbeed4548aad597a9784dc1ed5deba"/><file name="creditcard.phtml" hash="a6ee16f20da3e30f5e69b842733d735d"/><file name="directpay.phtml" hash="ad1411f184341fca5db6a4835604fcd1"/><file name="directpaymax.phtml" hash="c2ffc0a97df4342de20039634af4e2f0"/><file name="eps.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="eurodebit.phtml" hash="862e8f92191801bd180a3b9ea231f3e7"/><file name="giropay.phtml" hash="dee7411000671a92ec6566d056ff64a6"/><file name="ideal.phtml" hash="9fa3d535b9dcffe76d31b10b4dee18f7"/><file name="paysafe.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="poli.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="przelewy.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="qiwi.phtml" hash="d2bb7cad795645f5b0ed3d32c933cec3"/><file name="sepa.phtml" hash="fb93dbf3d6efad1f29de17eb7554c43e"/><file name="teleingreso.phtml" hash="07d2fb74b92b506fd5c94700d288d66d"/><file name="yellowpay.phtml" hash="092ff9792b4ab8a1f1cee1cce9c5c96b"/></dir><file name="form.phtml" hash="a2714b2ac583cc595a9afa63f93df2e7"/><file name="isapprove.phtml" hash="c527d3e50ca91452420cccb3053a90cf"/><file name="postback.phtml" hash="ea4284fc4456c417cacc0a4cde21dd49"/><file name="redirect.phtml" hash="7e0463cbc2141bb00f7265c92da62717"/><file name="response.phtml" hash="36dda28d50a5fb9d3dc76bdb6dee0525"/><file name="success.phtml" hash="5b505b11de29af9fa3e587e5c54af25e"/></dir></dir><dir name="layout"><file name="alternativepayments.xml" hash="9281d6239a2dc92c05ff040d4272df9b"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="alternativepayments"><dir name="css"><file name="styles.css" hash="fb7201cf0a6971e2a6815448b4f5c194"/></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/alternativepayments/css/styles.css ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
27
+ .sepa-make-tool img{
28
+ padding-top: 2px;
29
+ }
30
+
31
+ .sepa-make-tool {
32
+ cursor: help;
33
+ font-size: 11px;
34
+ margin-left: 5px;
35
+ }
36
+
37
+ .sepa-make-tool:hover {
38
+ text-decoration: none;
39
+ }
40
+
41
+ .ach-tool-tip-content td{
42
+ padding: 5px 5px 5px 0px;
43
+ }
44
+
45
+ .ach-tool-tip-content td.last{
46
+ padding-left: 5px;
47
+ padding-right: 0;
48
+ width: 165px;
49
+ }
50
+ .ach-tool-tip-content td img {
51
+ -webkit-border-radius: 3px;
52
+ -moz-border-radius: 3px;
53
+ border-radius: 3px;
54
+ border: 1px solid #A5A5A5;
55
+ display: block;
56
+ margin-left: auto;
57
+ margin-right: auto;
58
+ padding: 1px;
59
+ }
skin/frontend/base/default/alternativepayments/images/cvv22.gif ADDED
Binary file
skin/frontend/base/default/alternativepayments/images/information.png ADDED
Binary file
skin/frontend/base/default/alternativepayments/images/phoneverf1.jpg ADDED
Binary file
skin/frontend/base/default/alternativepayments/images/phoneverf2.jpg ADDED
Binary file
skin/frontend/base/default/alternativepayments/images/phoneverf3.jpg ADDED
Binary file
skin/frontend/base/default/alternativepayments/images/phoneverf4.jpg ADDED
Binary file
skin/frontend/base/default/alternativepayments/images/qm.gif ADDED
Binary file