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
+