PayItEasy - Version 0.1.1

Version Notes

Notes

Download this release

Release Info

Developer Jason Altehoefer
Extension PayItEasy
Version 0.1.1
Comparing to
See all releases


Version 0.1.1

Files changed (43) hide show
  1. app/code/community/Payiteasy/Onlinepayment/Block/Adminhtml/Information.php +44 -0
  2. app/code/community/Payiteasy/Onlinepayment/Block/Adminhtml/Information/Abstract.php +47 -0
  3. app/code/community/Payiteasy/Onlinepayment/Block/Adminhtml/System/Config/Notice.php +99 -0
  4. app/code/community/Payiteasy/Onlinepayment/Block/Creditcard/Form.php +47 -0
  5. app/code/community/Payiteasy/Onlinepayment/Block/Creditcard/Redirect.php +5 -0
  6. app/code/community/Payiteasy/Onlinepayment/Block/Debit/Form.php +49 -0
  7. app/code/community/Payiteasy/Onlinepayment/Block/Standard/Redirect.php +5 -0
  8. app/code/community/Payiteasy/Onlinepayment/Helper/Data.php +5 -0
  9. app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Base.php +19 -0
  10. app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Capture.php +14 -0
  11. app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Debit.php +38 -0
  12. app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Refund.php +21 -0
  13. app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Type/Payment.php +24 -0
  14. app/code/community/Payiteasy/Onlinepayment/Model/Method/Abstract.php +296 -0
  15. app/code/community/Payiteasy/Onlinepayment/Model/Method/Creditcard.php +151 -0
  16. app/code/community/Payiteasy/Onlinepayment/Model/Method/Debit.php +74 -0
  17. app/code/community/Payiteasy/Onlinepayment/Model/Method/Standard.php +182 -0
  18. app/code/community/Payiteasy/Onlinepayment/Model/Observer.php +139 -0
  19. app/code/community/Payiteasy/Onlinepayment/Model/System/Config/Source/Order/Action.php +31 -0
  20. app/code/community/Payiteasy/Onlinepayment/controllers/Adminhtml/InformationController.php +43 -0
  21. app/code/community/Payiteasy/Onlinepayment/controllers/Checkout/OnepageController.php +80 -0
  22. app/code/community/Payiteasy/Onlinepayment/controllers/PaymentController.php +104 -0
  23. app/code/community/Payiteasy/Onlinepayment/etc/config.xml +194 -0
  24. app/code/community/Payiteasy/Onlinepayment/etc/system.xml +241 -0
  25. app/code/community/Payiteasy/Onlinepayment/sql/onlinepayment_setup/mysql4-install-0.1.0.php +8 -0
  26. app/code/community/Payiteasy/Onlinepayment/sql/onlinepayment_setup/mysql4-upgrade-0.1.0-0.1.1.php +19 -0
  27. app/design/adminhtml/default/default/layout/onlinepayment.xml +14 -0
  28. app/design/adminhtml/default/default/template/onlinepayment/information/iframe.phtml +33 -0
  29. app/design/adminhtml/default/default/template/onlinepayment/system/config/hint/payment_reference.phtml +40 -0
  30. app/design/frontend/base/default/layout/onlinepayment.xml +8 -0
  31. app/design/frontend/base/default/template/onlinepayment/creditcard_form.phtml +137 -0
  32. app/design/frontend/base/default/template/onlinepayment/debit_form.phtml +51 -0
  33. app/design/frontend/base/default/template/onlinepayment/form.phtml +137 -0
  34. app/design/frontend/base/default/template/onlinepayment/protect.phtml +12 -0
  35. app/design/frontend/base/default/template/onlinepayment/standard/redirect.phtml +8 -0
  36. app/etc/modules/Payiteasy_Onlinepayment.xml +9 -0
  37. app/locale/de_DE/Payiteasy_Onlinepayment.csv +15 -0
  38. app/locale/en_US/Payiteasy_Onlinepayment.csv +15 -0
  39. package.xml +18 -0
  40. skin/adminhtml/default/default/onlinepayment/images/payiteasy_logo.png +0 -0
  41. skin/adminhtml/default/default/onlinepayment/images/pie_mascot.png +0 -0
  42. skin/adminhtml/default/default/onlinepayment/onlinepayment.css +21 -0
  43. skin/frontend/base/default/css/directpos/custom.css +3 -0
app/code/community/Payiteasy/Onlinepayment/Block/Adminhtml/Information.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_Block
17
+ * @subpackage Adminhtml
18
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
+ * @author Matthias Walter <info@noovias.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.noovias.com
22
+ */
23
+
24
+ /**
25
+ *
26
+ * @category Payone
27
+ * @package Payone_Core_Block
28
+ * @subpackage Adminhtml
29
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
+ * @link http://www.noovias.com
32
+ */
33
+ class Payiteasy_Onlinepayment_Block_Adminhtml_Information extends Payiteasy_Onlinepayment_Block_Adminhtml_Information_Abstract
34
+ {
35
+
36
+ /**
37
+ * @return string
38
+ */
39
+ public function getPayiteasyUrl()
40
+ {
41
+ $url = $this->escapeUrl('http://www.pay-it-easy.de/');
42
+ return $url;
43
+ }
44
+ }
app/code/community/Payiteasy/Onlinepayment/Block/Adminhtml/Information/Abstract.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_Block
17
+ * @subpackage Adminhtml_Information
18
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
+ * @author Matthias Walter <info@noovias.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.noovias.com
22
+ */
23
+
24
+ /**
25
+ *
26
+ * @category Payone
27
+ * @package Payone_Core_Block
28
+ * @subpackage Adminhtml_Information
29
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
+ * @link http://www.noovias.com
32
+ */
33
+ abstract class Payiteasy_Onlinepayment_Block_Adminhtml_Information_Abstract extends Mage_Adminhtml_Block_Template
34
+ {
35
+ /**
36
+ *
37
+ */
38
+ public function _construct()
39
+ {
40
+ $this->setTemplate("onlinepayment/information/iframe.phtml");
41
+ }
42
+ /**
43
+ * @abstract
44
+ * @return mixed
45
+ */
46
+ abstract public function getPayiteasyUrl();
47
+ }
app/code/community/Payiteasy/Onlinepayment/Block/Adminhtml/System/Config/Notice.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_Block
17
+ * @subpackage Adminhtml_System
18
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
+ * @author Matthias Walter <info@noovias.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.noovias.com
22
+ */
23
+
24
+ /**
25
+ *
26
+ * @category Payone
27
+ * @package Payone_Core_Block
28
+ * @subpackage Adminhtml_System
29
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
+ * @link http://www.noovias.com
32
+ */
33
+ class Payiteasy_Onlinepayment_Block_Adminhtml_System_Config_Notice
34
+ extends Mage_Adminhtml_Block_Abstract
35
+ implements Varien_Data_Form_Element_Renderer_Interface
36
+ {
37
+ /**
38
+ * @var Mage_Core_Model_Config_Element
39
+ */
40
+ protected $configGroup = null;
41
+ /**
42
+ * @var Varien_Data_Form_Element_Abstract
43
+ */
44
+ protected $element = null;
45
+
46
+ /**
47
+ * Render fieldset html
48
+ *
49
+ * @param Varien_Data_Form_Element_Abstract $element
50
+ * @return string
51
+ */
52
+ public function render(Varien_Data_Form_Element_Abstract $element)
53
+ {
54
+ $this->element = $element;
55
+
56
+ if ($this->getTemplate() == null) {
57
+ $this->initTemplate();
58
+ }
59
+
60
+ $html = '';
61
+ if ($this->getTemplate() != '') {
62
+ $html = $this->toHtml();
63
+ }
64
+ return $html;
65
+ }
66
+
67
+ protected function initTemplate()
68
+ {
69
+ $hintElement = $this->getHintElement();
70
+
71
+ $template = '';
72
+ if ($hintElement instanceof Mage_Core_Model_Config_Element) {
73
+ /** @var $hintElement Mage_Core_Model_Config_Element */
74
+ $template = (string)$hintElement->template;
75
+ }
76
+ if ($template != '') {
77
+ $this->setTemplate($template);
78
+ }
79
+ }
80
+
81
+ protected function getHintElement()
82
+ {
83
+ if ($this->configGroup === null) {
84
+ $this->initConfigGroup();
85
+ }
86
+ return $this->configGroup->hint;
87
+ }
88
+
89
+ protected function initConfigGroup()
90
+ {
91
+ $this->configGroup = $this->getGroup();
92
+
93
+ if ($this->configGroup === null) {
94
+ $elementGroup = $this->element->getGroup();
95
+ $this->configGroup = $elementGroup;
96
+ }
97
+ }
98
+
99
+ }
app/code/community/Payiteasy/Onlinepayment/Block/Creditcard/Form.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 Mage
23
+ * @package Mage_Authorizenet
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Onlinepayment form block
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Authorizenet
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Payiteasy_Onlinepayment_Block_Creditcard_Form extends Mage_Payment_Block_Form_Cc {
36
+
37
+ /**
38
+ * Internal constructor
39
+ * Set info template for payment step
40
+ *
41
+ */
42
+ protected function _construct() {
43
+ parent::_construct();
44
+ $this->setTemplate('onlinepayment/creditcard_form.phtml');
45
+ }
46
+
47
+ }
app/code/community/Payiteasy/Onlinepayment/Block/Creditcard/Redirect.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Block_Creditcard_Redirect extends Mage_Core_Block_Template {
4
+
5
+ }
app/code/community/Payiteasy/Onlinepayment/Block/Debit/Form.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 Mage
23
+ * @package Mage_Authorizenet
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+
28
+ /**
29
+ * Onlinepayment form block
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Authorizenet
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class Payiteasy_Onlinepayment_Block_Debit_Form extends Mage_Payment_Block_Form
36
+ {
37
+
38
+ /**
39
+ * Internal constructor
40
+ * Set info template for payment step
41
+ *
42
+ */
43
+ protected function _construct()
44
+ {
45
+ parent::_construct();
46
+ $this->setTemplate('onlinepayment/debit_form.phtml');
47
+ }
48
+
49
+ }
app/code/community/Payiteasy/Onlinepayment/Block/Standard/Redirect.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Block_Standard_Redirect extends Mage_Core_Block_Template {
4
+
5
+ }
app/code/community/Payiteasy/Onlinepayment/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ }
app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Base.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: radu
5
+ * Date: 13.06.2013
6
+ * Time: 12:40
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+
10
+ class Payiteasy_Onlinepayment_Model_ApiRequest_Base extends ArrayObject
11
+ {
12
+ public $id = 'x1';
13
+ public $version = '1.0';
14
+
15
+ protected function _prepareAmount($amount)
16
+ {
17
+ return number_format($amount, 2) * 100;
18
+ }
19
+ }
app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Capture.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Model_ApiRequest_Capture extends Payiteasy_Onlinepayment_Model_ApiRequest_Base
4
+ {
5
+ const ACTION = 'capture';
6
+
7
+ public function __construct(Mage_Sales_Model_Order $order, Payiteasy_Onlinepayment_Model_Method_Abstract $model)
8
+ {
9
+ $this->paymentRequest = new Payiteasy_Onlinepayment_Model_ApiRequest_Type_Payment($order, $model);
10
+
11
+ $this->paymentRequest->action = self::ACTION;
12
+ $this->paymentRequest->txReferenceExtId = $model->getOrderId($order->getId()) . '_01';
13
+ }
14
+ }
app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Debit.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: radu
5
+ * Date: 13.06.2013
6
+ * Time: 14:44
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+
10
+ class Payiteasy_Onlinepayment_Model_ApiRequest_Debit extends Payiteasy_Onlinepayment_Model_ApiRequest_Base
11
+ {
12
+ public function __construct(Mage_Sales_Model_Order $order, Payiteasy_Onlinepayment_Model_Method_Abstract $model)
13
+ {
14
+ /**
15
+ * this does not currently work, there are some issues with the request xml schema validation
16
+ *
17
+ * TODO : should we remove these classes altogether ?
18
+ */
19
+ $this->paymentRequest = new Payiteasy_Onlinepayment_Model_ApiRequest_Type_Payment($order, $model);
20
+
21
+ $this->paymentRequest->action = $model->getActionMode();
22
+ $this->paymentRequest->amount = (string) ($this->_prepareAmount($order->getGrandTotal()));
23
+ $this->paymentRequest->currency = $order->getBaseCurrencyCode();
24
+
25
+ $this->paymentRequest->txReferenceExtId = $model->getOrderId($order->getId()) . '_01';
26
+
27
+ $this->paymentRequest->bankAccount = new ArrayObject();
28
+ }
29
+
30
+ public function setBankData($data)
31
+ {
32
+ $this->paymentRequest->bankAccount->bankCode = $data['debit_bank_code'];
33
+ $this->paymentRequest->bankAccount->accountNumber = $data['debit_account_number'];
34
+ $this->paymentRequest->bankAccount->holder = $data['debit_holder'];
35
+ }
36
+
37
+
38
+ }
app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Refund.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: radu
5
+ * Date: 13.06.2013
6
+ * Time: 11:41
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+
10
+ class Payiteasy_Onlinepayment_Model_ApiRequest_Refund extends Payiteasy_Onlinepayment_Model_ApiRequest_Base
11
+ {
12
+ const ACTION = 'reversal';
13
+
14
+ public function __construct(Mage_Sales_Model_Order $order, Payiteasy_Onlinepayment_Model_Method_Abstract $model)
15
+ {
16
+ $this->paymentRequest = new Payiteasy_Onlinepayment_Model_ApiRequest_Type_Payment($order, $model);
17
+
18
+ $this->paymentRequest->action = self::ACTION;
19
+ $this->paymentRequest->txReferenceExtId = $model->getOrderId($order->getId()) . '_01';
20
+ }
21
+ }
app/code/community/Payiteasy/Onlinepayment/Model/ApiRequest/Type/Payment.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: radu
5
+ * Date: 13.06.2013
6
+ * Time: 11:48
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+
10
+ class Payiteasy_Onlinepayment_Model_ApiRequest_Type_Payment extends ArrayObject
11
+ {
12
+ public $id = 'ref_36b0e18138645f49ad2051ca25c3bf39';
13
+ public $xid = '1234567890123456789012345678';
14
+ public $kind = 'creditcard';
15
+
16
+ public function __construct(Mage_Sales_Model_Order $order, Payiteasy_Onlinepayment_Model_Method_Abstract $model)
17
+ {
18
+ $this->merchantId = $model->getMerchantId();
19
+ $this->eventExtId = $model->getOrderId($order->getId());
20
+
21
+ $this->kind = $model->getRequestKind();
22
+
23
+ }
24
+ }
app/code/community/Payiteasy/Onlinepayment/Model/Method/Abstract.php ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: radu
5
+ * Date: 12.06.2013
6
+ * Time: 17:06
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+
10
+ class Payiteasy_Onlinepayment_Model_Method_Abstract extends Mage_Payment_Model_Method_Abstract
11
+ {
12
+ /**
13
+ * number of hours that can pass before a payment made via 'AUTHORIZED' method can be REVERSED
14
+ */
15
+ const AUTHORIZED_REVERSAL_LIMIT_HOURS = '24';
16
+
17
+ /**
18
+ * Onlinepayment gateway URL
19
+ */
20
+ const API_URL = 'https://merch.directpos.de/soapapi/services/XmlApiNl';
21
+
22
+ /**
23
+ * Onlinepayment test gateway URL
24
+ */
25
+ const API_URL_TEST = 'https://testmerch.directpos.de/soapapi/services/XmlApiNl';
26
+
27
+ /*
28
+ * Onlinepayment Xml Request URL
29
+ */
30
+ const DP_URL_TD = 'http://www.voeb-zvd.de/xmlapi/1.0';
31
+
32
+ const REQUEST_TYPE_AUTH = 'authorization';
33
+ const REQUEST_TYPE_PRE_AUTH = 'preauthorization';
34
+ /**
35
+ * the "REFUND" functionality seems to be a 'reversal' action on directPOS admin panel
36
+ */
37
+ const REQUEST_TYPE_REFUND = 'reversal';
38
+
39
+ const RESPONSE_CODE_APPROVED = '0000';
40
+
41
+ const FORM_REQUEST_KIND = 'creditcard';
42
+ const CSS_URL = 'custom.css';
43
+
44
+ protected $_code;
45
+ protected $_requestKind;
46
+
47
+ /**
48
+ * @param $methodCode
49
+ * @return Mage_Core_Model_Abstract
50
+ */
51
+ public static function factory($methodCode)
52
+ {
53
+ $modelKey = '';
54
+ switch ($methodCode) {
55
+ case Payiteasy_Onlinepayment_Model_Method_Standard::METHOD_CODE:
56
+ $modelKey = 'onlinepayment/method_standard';
57
+ break;
58
+ case Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE:
59
+ $modelKey = 'onlinepayment/method_creditcard';
60
+ break;
61
+ case Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE:
62
+ $modelKey = 'onlinepayment/method_debit';
63
+ break;
64
+ }
65
+ if ($modelKey) {
66
+ return Mage::getModel($modelKey);
67
+ }
68
+
69
+ return null;
70
+ }
71
+
72
+
73
+ /**
74
+ * issue a refund for a order
75
+ *
76
+ * @see Payiteasy_Onlinepayment_Model_Observer::refund
77
+ *
78
+ * @param $order
79
+ * @return string
80
+ */
81
+ public function sendReversal($order)
82
+ {
83
+ try {
84
+ $soap = $this->_getSoapClient();
85
+ $request = new Payiteasy_Onlinepayment_Model_ApiRequest_Refund($order, $this);
86
+ $response = $soap->process($request);
87
+ return $response->paymentResponse;
88
+
89
+ } catch (Exception $e) {
90
+ Mage::throwException(Mage::helper('onlinepayment')->__('Refund updating error.'));
91
+ }
92
+
93
+ return;
94
+ }
95
+
96
+ /**
97
+ * send a capture-payment request
98
+ * @param Mage_Sales_Model_Order $order
99
+ */
100
+ public function sendCapture(Mage_Sales_Model_Order $order)
101
+ {
102
+ try {
103
+ $soap = $this->_getSoapClient();
104
+ $request = new Payiteasy_Onlinepayment_Model_ApiRequest_Capture($order, $this);
105
+ $response = $soap->process($request);
106
+ return $response->paymentResponse;
107
+ } catch (Exception $e) {
108
+ Mage::throwException(Mage::helper('onlinepayment')->__('Error at payment capture:') . $e->getMessage());
109
+ }
110
+
111
+ }
112
+
113
+ /**
114
+ * verify the previously made payment. if something is wrong, set order status to canceled
115
+ *and redirect customer to failed url
116
+ * @param $lastOrderId
117
+ * @return string
118
+ */
119
+ public function buildResponse($lastOrderId)
120
+ {
121
+ $requestBody = sprintf(
122
+ '<?xml version="1.0" encoding="utf-8"?>'
123
+ . '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'
124
+ . '<soapenv:Body>'
125
+ . '<xmlApiRequest version="1.0" id="x1" xmlns="%s">'
126
+ . '<txDiagnosisRequest id="ref_36b0e18138645f49ad2051ca25c3bf39">'
127
+ . '<merchantId>%s</merchantId>'
128
+ . '<eventExtId>%s</eventExtId>'
129
+ . '<kind>%s</kind>'
130
+ . '<txReferenceExtId>%s_01</txReferenceExtId>'
131
+ . '</txDiagnosisRequest>'
132
+ . '</xmlApiRequest>'
133
+ . '</soapenv:Body>'
134
+ . '</soapenv:Envelope>', $this->getXmlRequestUrl(), $this->getMerchantId(), $this->getOrderId($lastOrderId), $this->getRequestKind(), $this->getOrderId($lastOrderId)
135
+ );
136
+ try {
137
+ $client = $this->_getHttpClient();
138
+ $client->setRawData($requestBody);
139
+ $responseBody = $client->request()->getBody();
140
+ return $responseBody;
141
+ } catch (Exception $e) {
142
+ Mage::throwException(Mage::helper('onlinepayment')->__('Payment updating error.'));
143
+ }
144
+ }
145
+
146
+ /**
147
+ *
148
+ * instantiate soap client
149
+ * @return Zend_Soap_Client
150
+ */
151
+ protected function _getSoapClient()
152
+ {
153
+ $username = ($this->getConfigData('mode') == 1) ? $this->getUsername() : $this->getUsernameLive();
154
+ $password = ($this->getConfigData('mode') == 1) ? $this->getPassword() : $this->getPasswordLive();
155
+
156
+ $client = new Zend_Soap_Client($this->getApiWsdl(), array(
157
+ 'login' => $username,
158
+ 'password' => $password
159
+ ));
160
+ return $client;
161
+ }
162
+
163
+ /**
164
+ * sometimes SOAP will not work .......
165
+ */
166
+ protected function _getHttpClient()
167
+ {
168
+ $client = new Zend_Http_Client();
169
+ $uri = ($this->getConfigData('mode') == 1) ? self::API_URL_TEST : self::API_URL;
170
+ $client->setUri($uri);
171
+ $client->setConfig(array('timeout' => 45));
172
+ $client->setHeaders(array('Content-Type: text/xml'));
173
+ ($this->getConfigData('mode') == 1) ? $client->setAuth($this->getUsername(), $this->getPassword()) : $client->setAuth($this->getUsernameLive(), $this->getPasswordLive());
174
+ $client->setMethod(Zend_Http_Client::POST);
175
+
176
+ return $client;
177
+ }
178
+
179
+ public function getApiWsdl()
180
+ {
181
+ return ($this->getConfigData('mode') == 1 ? self::API_URL_TEST : self::API_URL) . '?wsdl';
182
+ }
183
+
184
+ /**
185
+ * @param $orderId
186
+ * @return string
187
+ */
188
+ public function getOrderId($orderId)
189
+ {
190
+ return trim(Mage::getStoreConfig('onlinepayment/onlinepayment_group/onlinepayment_merchant_id', Mage::app()->getStore())) . "_RB" . $orderId;
191
+ }
192
+
193
+ /**
194
+ * @return string
195
+ */
196
+ public function getXmlRequestUrl()
197
+ {
198
+ return self::DP_URL_TD;
199
+ }
200
+
201
+ /**
202
+ * methods for accessing configuration values
203
+ */
204
+ /**
205
+ * @return string
206
+ */
207
+ public function getMerchantId()
208
+ {
209
+ return trim(Mage::getStoreConfig('onlinepayment/onlinepayment_group/onlinepayment_merchant_id', Mage::app()->getStore()));
210
+ }
211
+
212
+ /**
213
+ * @return string
214
+ */
215
+ public function getUsernameLive()
216
+ {
217
+ return trim(Mage::getStoreConfig('onlinepayment/onlinepayment_group/onlinepayment_username_live', Mage::app()->getStore()));
218
+ }
219
+
220
+ /**
221
+ * @return string
222
+ */
223
+ public function getPasswordLive()
224
+ {
225
+ return trim(Mage::getStoreConfig('onlinepayment/onlinepayment_group/onlinepayment_password_live', Mage::app()->getStore()));
226
+ }
227
+
228
+ /**
229
+ * @return string
230
+ */
231
+ public function getUsername()
232
+ {
233
+ return trim(Mage::getStoreConfig('onlinepayment/onlinepayment_group/onlinepayment_username', Mage::app()->getStore()));
234
+ }
235
+
236
+ /**
237
+ * @return string
238
+ */
239
+ public function getPassword()
240
+ {
241
+ return trim(Mage::getStoreConfig('onlinepayment/onlinepayment_group/onlinepayment_password', Mage::app()->getStore()));
242
+ }
243
+
244
+ /**
245
+ * @return string
246
+ */
247
+ public function getCssUrl()
248
+ {
249
+ return trim(Mage::getStoreConfig('onlinepayment/onlinepayment_group/onlinepayment_css_url', Mage::app()->getStore()));
250
+ }
251
+
252
+ /**
253
+ * get curernt actionm mode
254
+ * @return string
255
+ */
256
+ public function getActionMode()
257
+ {
258
+ return trim($this->getConfigData('action'));
259
+ }
260
+
261
+ /**
262
+ * @return string
263
+ */
264
+ public function getRequestKind()
265
+ {
266
+ return $this->_requestKind;
267
+ }
268
+
269
+ protected function _prepareAmount($amount)
270
+ {
271
+ return number_format($amount, 2) * 100;
272
+ }
273
+
274
+ /**
275
+ *
276
+ * @param Mage_Sales_Model_Order $order
277
+ */
278
+ public function createInvoice($order)
279
+ {
280
+ try {
281
+ if ($order->canInvoice()) {
282
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
283
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
284
+ $invoice->register();
285
+ $invoice->sendEmail();
286
+ $order->addStatusHistoryComment("Invoice generation finished");
287
+ $transactionSave = Mage::getModel('core/resource_transaction')
288
+ ->addObject($invoice)
289
+ ->addObject($invoice->getOrder());
290
+ $transactionSave->save();
291
+ }
292
+ } catch (Mage_Core_Exception $e) {
293
+
294
+ }
295
+ }
296
+ }
app/code/community/Payiteasy/Onlinepayment/Model/Method/Creditcard.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Model_Method_Creditcard extends Payiteasy_Onlinepayment_Model_Method_Abstract
4
+ {
5
+
6
+ const REQUEST_TYPE_CREATE = 'create';
7
+
8
+ const METHOD_CODE = 'directpos_cc';
9
+
10
+ protected $_code = self::METHOD_CODE;
11
+
12
+ protected $_requestKind = 'creditcard';
13
+
14
+ /**
15
+ * Availability options
16
+ */
17
+ protected $_isGateway = false;
18
+ protected $_canAuthorize = true;
19
+ protected $_canCapture = true;
20
+ protected $_canCapturePartial = false;
21
+ protected $_canRefund = true;
22
+ protected $_canVoid = true;
23
+ protected $_canUseInternal = true;
24
+ protected $_canUseCheckout = true;
25
+ protected $_canUseForMultishipping = true;
26
+ protected $_canSaveCc = false;
27
+ protected $_formBlockType = 'onlinepayment/creditcard_form';
28
+
29
+ public function getMethodCode()
30
+ {
31
+ return self::METHOD_CODE;
32
+ }
33
+
34
+ public function getOrderPlaceRedirectUrl()
35
+ {
36
+ return Mage::getUrl('onlinepayment/payment/result');
37
+ }
38
+
39
+ public function buildRequestCreatePanalias($data)
40
+ {
41
+ $requestBody = sprintf(
42
+ '<?xml version="1.0" encoding="utf-8"?>'
43
+ . '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'
44
+ . '<soapenv:Body>'
45
+ . '<xmlApiRequest version="1.0" id="x1" xmlns="%s">'
46
+ . '<panAliasRequest id="ref_36b0e18138645f49ad2051ca25c3bf39">'
47
+ . '<merchantId>%s</merchantId>'
48
+ . '<action>%s</action>'
49
+ . '<pan>%s</pan>'
50
+ . '<expiryDate>'
51
+ . '<month>%s</month>'
52
+ . '<year>%s</year>'
53
+ . '</expiryDate>'
54
+ . '</panAliasRequest>'
55
+ . '</xmlApiRequest>'
56
+ . '</soapenv:Body>'
57
+ . '</soapenv:Envelope>', $this->getXmlRequestUrl(), $this->getMerchantId(), self::REQUEST_TYPE_CREATE, $data["cc_number"], $data["cc_exp_month"], $data["cc_exp_year"]
58
+ );
59
+
60
+ $client = new Zend_Http_Client();
61
+ $uri = ($this->getConfigData('mode') == 1) ? self::API_URL_TEST : self::API_URL;
62
+ $client->setUri($uri);
63
+ $client->setConfig(array('timeout' => 45));
64
+ $client->setHeaders(array('Content-Type: text/xml'));
65
+ ($this->getConfigData('mode') == 1) ? $client->setAuth($this->getUsername(), $this->getPassword()) : $client->setAuth($this->getUsernameLive(), $this->getPasswordLive());
66
+ $client->setMethod(Zend_Http_Client::POST);
67
+ $client->setRawData($requestBody);
68
+
69
+ $debugData = array('request' => $requestBody);
70
+ try {
71
+ $responseBody = $client->request()->getBody();
72
+ $debugData['result'] = $responseBody;
73
+ $this->_debug($debugData);
74
+ $panalias = $this->_returnPanaliasFromString($responseBody);
75
+ return $panalias;
76
+ } catch (Exception $e) {
77
+ $message = Mage::helper('onlinepayment')->__('Payment updating error.');
78
+ $message .= ' (' . $e->getMessage() . ')';
79
+ Mage::throwException($message);
80
+ }
81
+ }
82
+
83
+ public function buildRequestCapture($order)
84
+ {
85
+ switch (trim(Mage::getStoreConfig('payment/directpos_cc/action', Mage::app()->getStore()))) {
86
+ case 'authorization':
87
+ $actionMode = self::REQUEST_TYPE_AUTH;
88
+ break;
89
+ case 'preauthorization':
90
+ $actionMode = self::REQUEST_TYPE_PRE_AUTH;
91
+ break;
92
+ default:
93
+ $actionMode = self::REQUEST_TYPE_PRE_AUTH;
94
+ }
95
+
96
+ $payment = $order->getPayment();
97
+
98
+ $amount = $this->_prepareAmount($order->getGrandTotal());
99
+
100
+ if ($amount > 0) {
101
+ $requestBody = sprintf(
102
+ '<?xml version="1.0" encoding="utf-8"?>'
103
+ . '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'
104
+ . '<soapenv:Body>'
105
+ . '<xmlApiRequest version="1.0" id="x1" xmlns="%s">'
106
+ . '<paymentRequest id="ref_36b0e18138645f49ad2051ca25c3bf39">'
107
+ . '<merchantId>%s</merchantId>'
108
+ . '<eventExtId>%s</eventExtId>'
109
+ . '<basketId>%s</basketId>'
110
+ . '<kind>%s</kind>'
111
+ . '<action>%s</action>'
112
+ . '<amount>%s</amount>'
113
+ . '<currency>%s</currency>'
114
+ . '<creditCard>'
115
+ . "<panalias generate='false'>%s</panalias>"
116
+ . '</creditCard>'
117
+ . '</paymentRequest>'
118
+ . '</xmlApiRequest>'
119
+ . '</soapenv:Body>'
120
+ . '</soapenv:Envelope>', $this->getXmlRequestUrl(), $this->getMerchantId(), $this->getOrderId($order->getId()),
121
+ $order->getId(), self::FORM_REQUEST_KIND, $actionMode, $amount, $order->getBaseCurrencyCode(), $payment->getCcNumberEnc()
122
+ );
123
+
124
+ $client = new Zend_Http_Client();
125
+ $uri = ($this->getConfigData('mode') == 1) ? self::API_URL_TEST : self::API_URL;
126
+ $client->setUri($uri);
127
+ $client->setConfig(array('timeout' => 45));
128
+ $client->setHeaders(array('Content-Type: text/xml'));
129
+ ($this->getConfigData('mode') == 1) ? $client->setAuth($this->getUsername(), $this->getPassword()) : $client->setAuth($this->getUsernameLive(), $this->getPasswordLive());
130
+ $client->setMethod(Zend_Http_Client::POST);
131
+ $client->setRawData($requestBody);
132
+
133
+ try {
134
+ $responseBody = $client->request()->getBody();
135
+ return $responseBody;
136
+ } catch (Exception $e) {
137
+ Mage::throwException(Mage::helper('onlinepayment')->__('Payment updating error.'));
138
+ }
139
+ }
140
+ }
141
+
142
+ private function _returnPanaliasFromString($body)
143
+ {
144
+ if (!preg_match('/<panalias>([^<]+)<\/panalias>/', $body, $m)) {
145
+ throw new Exception(Mage::helper('onlinepayment')->__('Please try again using a different payment method.'));
146
+ }
147
+ return $m[1];
148
+ }
149
+
150
+ }
151
+
app/code/community/Payiteasy/Onlinepayment/Model/Method/Debit.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Model_Method_Debit extends Payiteasy_Onlinepayment_Model_Method_Abstract
4
+ {
5
+ /**
6
+ *
7
+ */
8
+ const METHOD_CODE = 'directpos_elv';
9
+
10
+ protected $_code = self::METHOD_CODE;
11
+
12
+ protected $_requestKind = 'debit';
13
+
14
+ protected $_isGateway = false;
15
+ protected $_canAuthorize = true;
16
+ protected $_canCapture = true;
17
+ protected $_canCapturePartial = false;
18
+ protected $_canRefund = true;
19
+ protected $_canVoid = true;
20
+ protected $_canUseInternal = true;
21
+ protected $_canUseCheckout = true;
22
+ protected $_canUseForMultishipping = true;
23
+ protected $_canSaveCc = false;
24
+ protected $_formBlockType = 'onlinepayment/debit_form';
25
+
26
+ public function getOrderPlaceRedirectUrl()
27
+ {
28
+ return Mage::getUrl('onlinepayment/payment/result');
29
+ }
30
+
31
+ public function buildRequestCapture($order)
32
+ {
33
+ $client = $this->_getHttpClient();
34
+ $data = Mage::getSingleton('checkout/session')->paymentData;
35
+
36
+ $requestBody = sprintf(
37
+ '<?xml version="1.0" encoding="utf-8"?>'
38
+ . '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'
39
+ . '<soapenv:Body>'
40
+ . '<xmlApiRequest version="1.0" id="x1" xmlns="%s">'
41
+ . '<paymentRequest id="ref_36b0e18138645f49ad2051ca25c3bf39">'
42
+ . '<merchantId>%s</merchantId>'
43
+ . '<eventExtId>%s</eventExtId>'
44
+ . '<basketId>%s</basketId>'
45
+ . '<kind>%s</kind>'
46
+ . '<action>%s</action>'
47
+ . '<amount>%s</amount>'
48
+ . '<currency>%s</currency>'
49
+ . "<bankAccount>"
50
+ . '<bankCode>%s</bankCode>'
51
+ . '<accountNumber>%s</accountNumber>'
52
+ . '<holder>%s</holder>'
53
+ . '</bankAccount>'
54
+ . '</paymentRequest>'
55
+ . '</xmlApiRequest>'
56
+ . '</soapenv:Body>'
57
+ . '</soapenv:Envelope>',
58
+ $this->getXmlRequestUrl(), $this->getMerchantId(),
59
+ $this->getOrderId($order->getId()), $order->getId(), $this->getRequestKind(),
60
+ $this->getActionMode(), $this->_prepareAmount($order->getGrandTotal()), $order->getBaseCurrencyCode(),
61
+ $data['debit_bank_code'], $data['debit_account_number'], $data['debit_holder']
62
+ );
63
+ $client->setRawData($requestBody);
64
+
65
+ try {
66
+ $responseBody = $client->request()->getBody();
67
+ unset(Mage::getSingleton('checkout/session')->paymentData);
68
+ return $responseBody;
69
+ } catch (Exception $e) {
70
+ Mage::throwException(Mage::helper('onlinepayment')->__('Error sending payment data'));
71
+ }
72
+ }
73
+
74
+ }
app/code/community/Payiteasy/Onlinepayment/Model/Method/Standard.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Model_Method_Standard extends Payiteasy_Onlinepayment_Model_Method_Abstract
4
+ {
5
+
6
+ const METHOD_CODE = 'directpos_std';
7
+
8
+ protected $_code = self::METHOD_CODE;
9
+
10
+ protected $_requestKind = 'creditcard';
11
+
12
+ /**
13
+ * Availability options
14
+ */
15
+ protected $_isGateway = false;
16
+ protected $_canAuthorize = true;
17
+ protected $_canCapture = true;
18
+ protected $_canCapturePartial = false;
19
+ protected $_canRefund = false;
20
+ protected $_canVoid = true;
21
+ protected $_canUseInternal = true;
22
+ protected $_canUseCheckout = true;
23
+ protected $_canUseForMultishipping = true;
24
+ protected $_canSaveCc = false;
25
+ protected $_canCreditmemo = false;
26
+
27
+ public function getOrderPlaceRedirectUrl()
28
+ {
29
+ return Mage::getUrl('onlinepayment/payment/redirect', array('_secure' => true));
30
+ }
31
+
32
+ public function getRedirectAfterUrl()
33
+ {
34
+ return Mage::getUrl('onlinepayment/payment/response', array('_secure' => true));
35
+ }
36
+
37
+ public function getMethodCode()
38
+ {
39
+ return self::METHOD_CODE;
40
+ }
41
+
42
+ public function getNotificationUrl()
43
+ {
44
+ return Mage::getUrl('onlinepayment/payment/response');
45
+ }
46
+
47
+ public function buildRequest(Varien_Object $order)
48
+ {
49
+ switch (trim(Mage::getStoreConfig('payment/directpos_std/action', Mage::app()->getStore()))) {
50
+ case 'authorization':
51
+ $actionMode = self::REQUEST_TYPE_AUTH;
52
+ break;
53
+ case 'preauthorization':
54
+ $actionMode = self::REQUEST_TYPE_PRE_AUTH;
55
+ break;
56
+ default:
57
+ $actionMode = self::REQUEST_TYPE_PRE_AUTH;
58
+ }
59
+
60
+ $amount = $order->getGrandTotal();
61
+ if ($amount > 0) {
62
+ $amount = $this->_prepareAmount($amount);
63
+ $requestBody = sprintf(
64
+ '<?xml version="1.0" encoding="utf-8"?>'
65
+ . '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'
66
+ . '<soapenv:Body>'
67
+ . '<xmlApiRequest version="1.0" id="x1" xmlns="%s">'
68
+ . '<formServiceRequest id="ref_36b0e18138645f49ad2051ca25c3bf39">'
69
+ . '<merchantId>%s</merchantId>'
70
+ . '<eventExtId>%s</eventExtId>'
71
+ . '<basketId>%s</basketId>'
72
+ . '<kind>%s</kind>'
73
+ . '<action>%s</action>'
74
+ . '<amount>%s</amount>'
75
+ . '<currency>%s</currency>'
76
+ . '<formData><cssURL>%s</cssURL></formData>'
77
+ . '<callbackData><notifyURL>%s</notifyURL></callbackData>'
78
+ . '<customerContinuation><successURL>%s</successURL></customerContinuation>'
79
+ . '</formServiceRequest>'
80
+ . '</xmlApiRequest>'
81
+ . '</soapenv:Body>'
82
+ . '</soapenv:Envelope>', $this->getXmlRequestUrl(), $this->getMerchantId(), $this->getOrderId($order->getId()),
83
+ $order->getId(), self::FORM_REQUEST_KIND, $actionMode, $amount, $order->getBaseCurrencyCode(), $this->getCssUrl(),
84
+ $this->getNotificationUrl(), $this->getRedirectAfterUrl()
85
+ );
86
+
87
+ if ($order->getEmailSent() != 1) {
88
+ //$order->sendNewOrderEmail();
89
+ }
90
+
91
+ $client = new Zend_Http_Client();
92
+ $uri = ($this->getConfigData('mode') == 1) ? self::API_URL_TEST : self::API_URL;
93
+ $client->setUri($uri);
94
+ $client->setConfig(array('timeout' => 45));
95
+ $client->setHeaders(array('Content-Type: text/xml'));
96
+ ($this->getConfigData('mode') == 1) ? $client->setAuth($this->getUsername(), $this->getPassword()) : $client->setAuth($this->getUsernameLive(), $this->getPasswordLive());
97
+ $client->setMethod(Zend_Http_Client::POST);
98
+ $client->setRawData($requestBody);
99
+
100
+ $debugData = array('request' => $requestBody);
101
+
102
+ try {
103
+ $responseBody = $client->request()->getBody();
104
+ $debugData['result'] = $responseBody;
105
+ $this->_debug($debugData);
106
+ $this->_processData($responseBody, $order);
107
+ } catch (Exception $e) {
108
+ Mage::throwException(Mage::helper('onlinepayment')->__('Payment updating error.'));
109
+ }
110
+ }
111
+ return true;
112
+ }
113
+
114
+ protected function _processData($xmlResponse, $order, $type = 'redirect')
115
+ {
116
+ if ($type == 'redirect') {
117
+ if (preg_match('/<formServiceURL>([^<]+)<\/formServiceURL>/', $xmlResponse, $m)) {
118
+ $this->_adminComments($order, Mage::helper('onlinepayment')->__('Client redirected to OnlinePayment Gateway'));
119
+ header("Location: {$m[1]}");
120
+ exit();
121
+ } else {
122
+ $this->_adminComments($order, Mage::helper('onlinepayment')->__('Error occured while redirecting to Gateway.'));
123
+ header("Location:" . Mage::getUrl());
124
+ exit();
125
+ }
126
+ }
127
+
128
+ if ($type == 'response') {
129
+ preg_match('/<rc>([^<]+)<\/rc>/', $xmlResponse, $m);
130
+ Mage::log(var_export($m, true));
131
+ return $m[1];
132
+ }
133
+ }
134
+
135
+ public function _adminComments($order, $message = '')
136
+ {
137
+ $order->addStatusHistoryComment($message);
138
+ $order->save();
139
+ return true;
140
+ }
141
+
142
+ /**
143
+ * read response from directPOS
144
+ * if everything is ok, set order status etc etc
145
+ * @param string $xml xml string containing response
146
+ *
147
+ * @return bool the result of the operation, true for successful payment, false otherwise
148
+ */
149
+ public function processResponse($xml)
150
+ {
151
+ $dom = new DOMDocument();
152
+ $dom->loadXML($xml);
153
+ $orderId = $dom->getElementsByTagName('basketId')->item(0)->nodeValue;
154
+ $rc = $dom->getElementsByTagName('rc')->item(0)->nodeValue;
155
+ $message = $dom->getElementsByTagName('message')->item(0)->nodeValue;
156
+
157
+ $order = Mage::getModel('sales/order')->load($orderId);
158
+
159
+ if ($rc != self::RESPONSE_CODE_APPROVED) {
160
+ //cancel order
161
+ $order->cancel();
162
+ $order->setStatus(Mage_Sales_Model_Order::STATE_CANCELED, true);
163
+ $message = Mage::helper('onlinepayment')->__('FormularService payment - Some transaction problems caused this order to change it\'s status to cancelled. (%s)', $message);
164
+ $order->addStatusHistoryComment($message);
165
+ $order->save();
166
+ return false;
167
+ }
168
+
169
+ /* everything looks fine, create invoice (if needed) */
170
+ $order->setOnlinepaymentStatusUpdate(1); //save payment status flag, so we can redirect the user to success page
171
+ if ($order->getEmailSent() != 1) {
172
+ $order->sendNewOrderEmail();
173
+ }
174
+
175
+ //redirect to success
176
+ $message = Mage::helper('onlinepayment')->__('Order paid successfully via Onlinepayment FormularService method.');
177
+ $order->addStatusHistoryComment($message);
178
+ $order->save();
179
+
180
+ return true;
181
+ }
182
+ }
app/code/community/Payiteasy/Onlinepayment/Model/Observer.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Model_Observer
4
+ {
5
+
6
+ public function sendPayment($observer)
7
+ {
8
+ $order = $observer->getEvent()->getOrder();
9
+
10
+ $payment = $order->getPayment()->getMethodInstance();
11
+
12
+ $allowed = array(
13
+ Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE,
14
+ Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE
15
+ );
16
+
17
+ if (in_array($payment->getCode(), $allowed)) {
18
+ $paymentMethod = Payiteasy_Onlinepayment_Model_Method_Abstract::factory($payment->getCode());
19
+ $paymentMethod->buildRequestCapture($order);
20
+ return true;
21
+ }
22
+ }
23
+
24
+ /**
25
+ * refund action, triggers a 'reversal' process on directPOS
26
+ *
27
+ * refund is possible on any payment implemented via this service -
28
+ *
29
+ * triggered when shop admin cancels the order
30
+ *
31
+ * @param $observer
32
+ * @return bool
33
+ */
34
+ public function reversal($observer)
35
+ {
36
+ /* @var $payment Mage_Sales_Model_Order_Payment */
37
+ $payment = $observer->getPayment();
38
+ $order = $payment->getOrder();
39
+ /* @var $methodInstance Payiteasy_Onlinepayment_Model_Method_Abstract */
40
+ $methodInstance = $payment->getMethodInstance();
41
+
42
+ $allowed = array(
43
+ Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE,
44
+ Payiteasy_Onlinepayment_Model_Method_Standard::METHOD_CODE,
45
+ Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE,
46
+ );
47
+ if (!in_array($payment->getMethod(), $allowed)) {
48
+ return;
49
+ }
50
+
51
+ try {
52
+ $actionMode = $payment->getData('onlinepayment_action_mode');
53
+ if (empty($actionMode)) {
54
+ $actionMode = $methodInstance->getActionMode();
55
+ }
56
+ $canSendReversal = true;
57
+ switch ($actionMode) {
58
+ case Payiteasy_Onlinepayment_Model_Method_Abstract::REQUEST_TYPE_AUTH:
59
+ /* in case of authorized transactions, only allow reversals of orders made in the last 24 hrs */
60
+ $createdAt = strtotime($order->getCreatedAt());
61
+ $now = time();
62
+ if ($now - $createdAt > (Payiteasy_Onlinepayment_Model_Method_Abstract::AUTHORIZED_REVERSAL_LIMIT_HOURS * 3600)) { /* older than 1 day */
63
+ $canSendReversal = false;
64
+ }
65
+ break;
66
+ default:
67
+ break;
68
+ }
69
+ if (!$canSendReversal) {
70
+ $message = Mage::helper('onlinepayment')->__('This order has been made more than %s hours ago, skipping the REVERSAL-request', Payiteasy_Onlinepayment_Model_Method_Abstract::AUTHORIZED_REVERSAL_LIMIT_HOURS);
71
+ $order->addStatusHistoryComment($message)
72
+ ->save();
73
+ return;
74
+ }
75
+
76
+ $response = $methodInstance->sendReversal($order, true);
77
+
78
+ if (! $response || $response->rc != '0000') {
79
+ $message = Mage::helper('onlinepayment')->__('Problems at reversal. Error code: ') . ($response ? $response->rc : 'empty response');
80
+ } else {
81
+ $message = Mage::helper('onlinepayment')->__('DirectPOS Reversal - request completed');
82
+ }
83
+ $order->addStatusHistoryComment($message)
84
+ ->save();
85
+ return true;
86
+ } catch (Exception $e) {
87
+
88
+ }
89
+ }
90
+
91
+ /**
92
+ * capture a pre-authorized payment
93
+ * @param $observer
94
+ */
95
+ public function capture($observer)
96
+ {
97
+ /* @var $payment Mage_Sales_Model_Order_Payment */
98
+ $payment = $observer->getPayment();
99
+ $order = $payment->getOrder();
100
+ /* @var $methodInstance Payiteasy_Onlinepayment_Model_Method_Abstract */
101
+ $methodInstance = $payment->getMethodInstance();
102
+
103
+ $allowed = array(
104
+ Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE,
105
+ Payiteasy_Onlinepayment_Model_Method_Standard::METHOD_CODE,
106
+ Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE,
107
+ );
108
+ if (!in_array($payment->getMethod(), $allowed)) {
109
+ return;
110
+ }
111
+ $actionMode = $payment->getData('onlinepayment_action_mode');
112
+ if (empty($actionMode)) {
113
+ $actionMode = $methodInstance->getActionMode();
114
+ }
115
+ if ($actionMode == Payiteasy_Onlinepayment_Model_Method_Abstract::REQUEST_TYPE_AUTH) {
116
+ $order->addStatusHistoryComment(Mage::helper('onlinepayment')->__('The action method for this payment was set to authorization, the payment should already be captured'))
117
+ ->save();
118
+ return;
119
+ }
120
+ try {
121
+ $response = $methodInstance->sendCapture($order);
122
+
123
+ if (! $response || $response->rc != '0000') {
124
+ $message = Mage::helper('onlinepayment')->__('Problems at capture. Error code: ') . ($response ? $response->rc : 'empty response');
125
+ } else {
126
+ $message = Mage::helper('onlinepayment')->__('DirectPOS Payment Capture completed');
127
+ }
128
+ $order->addStatusHistoryComment($message)
129
+ ->save();
130
+ return true;
131
+ } catch (Exception $e) {
132
+ $message = Mage::helper('onlinepayment')->__('Problems at capture. Error: ') . $e->getMessage();
133
+ $order->addStatusHistoryComment($message)
134
+ ->save();
135
+ }
136
+
137
+ }
138
+ }
139
+
app/code/community/Payiteasy/Onlinepayment/Model/System/Config/Source/Order/Action.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_Model_System_Config_Source_Order_Action {
4
+
5
+ /**
6
+ * Options getter
7
+ *
8
+ * @return array
9
+ */
10
+ public function toOptionArray()
11
+ {
12
+ return array(
13
+ array('value' => 'preauthorization', 'label'=>Mage::helper('onlinepayment')->__('Preauthorization')),
14
+ array('value' => 'authorization', 'label'=>Mage::helper('onlinepayment')->__('Authorization')),
15
+ );
16
+ }
17
+
18
+ /**
19
+ * Get options in "key-value" format
20
+ *
21
+ * @return array
22
+ */
23
+ public function toArray()
24
+ {
25
+ return array(
26
+ 'preauthorization' => Mage::helper('onlinepayment')->__('Preauthorization'),
27
+ 'authorization' => Mage::helper('onlinepayment')->__('Authorization'),
28
+ );
29
+ }
30
+
31
+ }
app/code/community/Payiteasy/Onlinepayment/controllers/Adminhtml/InformationController.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_controllers
17
+ * @subpackage Adminhtml
18
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
+ * @author Matthias Walter <info@noovias.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.noovias.com
22
+ */
23
+
24
+ /**
25
+ *
26
+ * @category Payone
27
+ * @package Payone_Core_controllers
28
+ * @subpackage Adminhtml
29
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
+ * @link http://www.noovias.com
32
+ */
33
+ class Payiteasy_Onlinepayment_Adminhtml_InformationController extends Mage_Adminhtml_Controller_Action
34
+ {
35
+ /**
36
+ *
37
+ */
38
+ public function indexAction()
39
+ {
40
+ $this->loadLayout();
41
+ $this->renderLayout();
42
+ }
43
+ }
app/code/community/Payiteasy/Onlinepayment/controllers/Checkout/OnepageController.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the GNU General Public License (GPL 3)
8
+ * that is bundled with this package in the file LICENSE.txt
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
13
+ * versions in the future. If you wish to customize Payone_Core for your
14
+ * needs please refer to http://www.payone.de for more information.
15
+ *
16
+ */
17
+ require_once 'Mage/Checkout/controllers/OnepageController.php';
18
+
19
+ class Payiteasy_Onlinepayment_Checkout_OnepageController extends Mage_Checkout_OnepageController
20
+ {
21
+ /**
22
+ * Save payment ajax action
23
+ *
24
+ * Sets either redirect or a JSON response
25
+ */
26
+ public function savePaymentAction()
27
+ {
28
+ if ($this->_expireAjax()) {
29
+ return;
30
+ }
31
+ try {
32
+ if (!$this->getRequest()->isPost()) {
33
+ $this->_ajaxRedirectResponse();
34
+ return;
35
+ }
36
+
37
+ // set payment to quote
38
+ $result = array();
39
+ $data = $this->getRequest()->getPost('payment', array());
40
+
41
+ $paymentMethod = Payiteasy_Onlinepayment_Model_Method_Abstract::factory($data['method']);
42
+ if (null !== $paymentMethod) {
43
+ $data['onlinepayment_action_mode'] = $paymentMethod->getActionMode();
44
+ }
45
+
46
+ if ($data['method'] == Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE) {
47
+ $data['cc_number_enc'] = Mage::getModel('onlinepayment/method_creditcard')->buildRequestCreatePanalias($data);
48
+ } elseif ($data['method'] == Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE) {
49
+ Mage::getSingleton('checkout/session')->paymentData = $data;
50
+ }
51
+ $result = $this->getOnepage()->savePayment($data);
52
+
53
+ // get section and redirect data
54
+ $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
55
+ if (empty($result['error']) && !$redirectUrl) {
56
+ $this->loadLayout('checkout_onepage_review');
57
+ $result['goto_section'] = 'review';
58
+ $result['update_section'] = array(
59
+ 'name' => 'review',
60
+ 'html' => $this->_getReviewHtml()
61
+ );
62
+ }
63
+ if ($redirectUrl) {
64
+ $result['redirect'] = $redirectUrl;
65
+ }
66
+ } catch (Mage_Payment_Exception $e) {
67
+ if ($e->getFields()) {
68
+ $result['fields'] = $e->getFields();
69
+ }
70
+ $result['error'] = $e->getMessage();
71
+ } catch (Mage_Core_Exception $e) {
72
+ $result['error'] = $e->getMessage();
73
+ } catch (Exception $e) {
74
+ Mage::logException($e);
75
+ $result['error'] = $this->__('Unable to set Payment Method.');
76
+ }
77
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
78
+ }
79
+
80
+ }
app/code/community/Payiteasy/Onlinepayment/controllers/PaymentController.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Payiteasy_Onlinepayment_PaymentController extends Mage_Core_Controller_Front_Action {
4
+
5
+ /*
6
+ * Onlinepayment redirect after clicking the return button
7
+ *
8
+ * just for standard payments (!)
9
+ */
10
+ public function responseAction()
11
+ {
12
+ $request = $this->getRequest();
13
+ if ($request->isPost()) {
14
+ $data = file_get_contents('php://input');
15
+ Mage::getModel('onlinepayment/method_standard')->processResponse($data);
16
+ exit(); //this is a POST request, made by directPOS server directly. we can stop here
17
+ }
18
+
19
+ /** GET request, customer is on this page (he clicked "Return to shop") **/
20
+ $order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
21
+
22
+ if ($order->getOnlinepaymentStatusUpdate() != '1') {
23
+ /* something went wrong with the payment */
24
+ $order->cancel();
25
+ $order->setStatus(Mage_Sales_Model_Order::STATE_CANCELED, true);
26
+
27
+ $message = Mage::helper('onlinepayment')->__('Some transaction problems caused this order to change it\'s status to cancelled (did not receive payment response)');
28
+ $order->addStatusHistoryComment($message);
29
+ $order->save();
30
+ return $this->_redirect('checkout/onepage/failure');
31
+ }
32
+
33
+ /* everything looks fine */
34
+ return $this->_redirect('checkout/onepage/success');
35
+ }
36
+
37
+ /*
38
+ * this method redirects the customer to the payment gateway to enter credentials there
39
+ * SOAP is used
40
+ */
41
+ public function redirectAction() {
42
+ $this->loadLayout();
43
+ $block = $this->getLayout()->createBlock('Payiteasy_Onlinepayment_Block_Standard_Redirect','pay',array('template' => 'onlinepayment/standard/redirect.phtml'));
44
+ $this->getLayout()->getBlock('content')->append($block);
45
+ $this->renderLayout();
46
+ }
47
+
48
+ public function resultAction()
49
+ {
50
+ $session = Mage::getSingleton('checkout/session');
51
+ $lastOrderId = $session->getLastOrderId();
52
+
53
+ $order = Mage::getModel('sales/order')->load($lastOrderId);
54
+ $payment = $order->getPayment()->getMethodInstance();
55
+
56
+ $code = $payment->getCode();
57
+
58
+ if ($code == Payiteasy_Onlinepayment_Model_Method_Creditcard::METHOD_CODE || $code == Payiteasy_Onlinepayment_Model_Method_Debit::METHOD_CODE) {
59
+
60
+ $model = Payiteasy_Onlinepayment_Model_Method_Abstract::factory($code);
61
+ $responseBody = $model->buildResponse($lastOrderId);
62
+
63
+ if (!empty($responseBody)) {
64
+ $this->_processData($responseBody, $order);
65
+ }
66
+ }
67
+ }
68
+
69
+ private function _processData($xmlResponse, $order)
70
+ {
71
+ if (!empty($xmlResponse)) {
72
+
73
+ $payment = $order->getPayment()->getMethodInstance();
74
+ $code = $payment->getCode();
75
+ $model = Payiteasy_Onlinepayment_Model_Method_Abstract::factory($code);
76
+
77
+ preg_match('/<message>([^<]+)<\/message>/', $xmlResponse, $transaction);
78
+ preg_match('/<rc>([^<]+)<\/rc>/', $xmlResponse, $m);
79
+
80
+ if ($m[1] != '0000') {
81
+ //cancel order
82
+ $order->cancel();
83
+ $order->setStatus(Mage_Sales_Model_Order::STATE_CANCELED, true);
84
+
85
+ $message = Mage::helper('onlinepayment')->__('%s - Some transaction problems caused this order to change it\'s status to cancelled:', $model->getConfigData('title'));
86
+ $message .= '<br />' . $transaction[1];
87
+ $order->addStatusHistoryComment($message);
88
+ $order->save();
89
+ $this->_redirect('checkout/onepage/failure');
90
+ } else {
91
+ //redirect to success
92
+ if ($order->getEmailSent() != 1) {
93
+ $order->sendNewOrderEmail();
94
+ }
95
+
96
+ $message = Mage::helper('onlinepayment')->__('Payment success.');
97
+ $order->addStatusHistoryComment($message);
98
+ $order->save();
99
+
100
+ $this->_redirect('checkout/onepage/success');
101
+ }
102
+ }
103
+ }
104
+ }
app/code/community/Payiteasy/Onlinepayment/etc/config.xml ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Payiteasy_Onlinepayment>
5
+ <version>0.1.1</version>
6
+ </Payiteasy_Onlinepayment>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <onlinepayment>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Payiteasy_Onlinepayment</module>
14
+ <frontName>onlinepayment</frontName>
15
+ </args>
16
+ </onlinepayment>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <onlinepayment>
21
+ <file>onlinepayment.xml</file>
22
+ </onlinepayment>
23
+ </updates>
24
+ </layout>
25
+ <translate>
26
+ <modules>
27
+ <onlinepayment>
28
+ <files>
29
+ <default>Payiteasy_Onlinepayment.csv</default>
30
+ </files>
31
+ </onlinepayment>
32
+ </modules>
33
+ </translate>
34
+ </frontend>
35
+ <global>
36
+ <fieldsets>
37
+ <sales_convert_quote_payment>
38
+ <onlinepayment_action_mode>
39
+ <to_order_payment>*</to_order_payment>
40
+ </onlinepayment_action_mode>
41
+ </sales_convert_quote_payment>
42
+ </fieldsets>
43
+ <models>
44
+ <onlinepayment>
45
+ <class>Payiteasy_Onlinepayment_Model</class>
46
+ </onlinepayment>
47
+ </models>
48
+ <blocks>
49
+ <onlinepayment>
50
+ <class>Payiteasy_Onlinepayment_Block</class>
51
+ </onlinepayment>
52
+ </blocks>
53
+ <helpers>
54
+ <onlinepayment>
55
+ <class>Payiteasy_Onlinepayment_Helper</class>
56
+ </onlinepayment>
57
+ </helpers>
58
+ <resources>
59
+ <onlinepayment_setup>
60
+ <setup>
61
+ <module>Payiteasy_Onlinepayment</module>
62
+ </setup>
63
+ <connection>
64
+ <use>core_setup</use>
65
+ </connection>
66
+ </onlinepayment_setup>
67
+ <onlinepayment_write>
68
+ <connection>
69
+ <use>core_write</use>
70
+ </connection>
71
+ </onlinepayment_write>
72
+ </resources>
73
+ <payment>
74
+ <cc>
75
+ <types>
76
+ <VI>
77
+ <code>VI</code>
78
+ <name>Visa</name>
79
+ <order>0</order>
80
+ </VI>
81
+ <MC>
82
+ <code>MC</code>
83
+ <name>MasterCard</name>
84
+ <order>10</order>
85
+ </MC>
86
+ </types>
87
+ </cc>
88
+ <groups>
89
+ <offline>Offline Payment Methods</offline>
90
+ </groups>
91
+ </payment>
92
+ <events>
93
+ <sales_order_place_after>
94
+ <observers>
95
+ <onlinepayment_model_sales_order_save_after>
96
+ <type>singleton</type>
97
+ <class>Payiteasy_Onlinepayment_Model_Observer</class>
98
+ <method>sendPayment</method>
99
+ </onlinepayment_model_sales_order_save_after>
100
+ </observers>
101
+ </sales_order_place_after>
102
+ <sales_order_payment_cancel>
103
+ <observers>
104
+ <onlinepayment_model_sales_order_creditmemo_reversal>
105
+ <type>singleton</type>
106
+ <class>Payiteasy_Onlinepayment_Model_Observer</class>
107
+ <method>reversal</method>
108
+ </onlinepayment_model_sales_order_creditmemo_reversal>
109
+ </observers>
110
+ </sales_order_payment_cancel>
111
+ <sales_order_payment_capture>
112
+ <observers>
113
+ <onlinepayment_model_sales_order_pyment_capture>
114
+ <type>singleton</type>
115
+ <class>Payiteasy_Onlinepayment_Model_Observer</class>
116
+ <method>capture</method>
117
+ </onlinepayment_model_sales_order_pyment_capture>
118
+ </observers>
119
+ </sales_order_payment_capture>
120
+ </events>
121
+ </global>
122
+ <default>
123
+ <onlinepayment>
124
+ <onlinepayment_group>
125
+ <onlinepayment_username_live>firstfinance</onlinepayment_username_live>
126
+ <onlinepayment_password_live>G4k3RbXWED</onlinepayment_password_live>
127
+ <onlinepayment_username>fifapsp</onlinepayment_username>
128
+ <onlinepayment_password>voeb2000</onlinepayment_password>
129
+ <onlinepayment_css_url>frontend/base/default/css/onlinepayment/custom.css</onlinepayment_css_url>
130
+ </onlinepayment_group>
131
+ </onlinepayment>
132
+ <payment>
133
+ <directpos_std>
134
+ <active>0</active>
135
+ <model>onlinepayment/method_standard</model>
136
+ <order_status>pending</order_status>
137
+ <title>OnlinePayment - FormularService Method</title>
138
+ </directpos_std>
139
+ <directpos_cc>
140
+ <active>0</active>
141
+ <model>onlinepayment/method_creditcard</model>
142
+ <order_status>pending</order_status>
143
+ <title>OnlinePayment - Creditcard</title>
144
+ <cctypes>VI,MC</cctypes>
145
+ </directpos_cc>
146
+ <directpos_elv>
147
+ <active>0</active>
148
+ <model>onlinepayment/method_debit</model>
149
+ <order_status>pending</order_status>
150
+ <title>OnlinePayment - Direct Debit</title>
151
+ </directpos_elv>
152
+ </payment>
153
+ </default>
154
+ <adminhtml>
155
+ <layout>
156
+ <updates>
157
+ <onlinepayment>
158
+ <file>onlinepayment.xml</file>
159
+ </onlinepayment>
160
+ </updates>
161
+ </layout>
162
+ <translate>
163
+ <modules>
164
+ <onlinepayment>
165
+ <files>
166
+ <default>Payiteasy_Onlinepayment.csv</default>
167
+ </files>
168
+ </onlinepayment>
169
+ </modules>
170
+ </translate>
171
+ <acl>
172
+ <resources>
173
+ <all>
174
+ <title>Allow Everything</title>
175
+ </all>
176
+ <admin>
177
+ <children>
178
+ <system>
179
+ <children>
180
+ <config>
181
+ <children>
182
+ <onlinepayment>
183
+ <title>Payiteasy - All</title>
184
+ </onlinepayment>
185
+ </children>
186
+ </config>
187
+ </children>
188
+ </system>
189
+ </children>
190
+ </admin>
191
+ </resources>
192
+ </acl>
193
+ </adminhtml>
194
+ </config>
app/code/community/Payiteasy/Onlinepayment/etc/system.xml ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <onlinepayment translate="label" module="onlinepayment">
5
+ <label>PayItEasy</label>
6
+ <class>tab-payiteasy</class>
7
+ <sort_order>1000</sort_order>
8
+ </onlinepayment>
9
+ </tabs>
10
+ <sections>
11
+ <onlinepayment translate="label" module="onlinepayment">
12
+ <label>OnlinePayment Configuration</label>
13
+ <header_css>payiteasy-config-header</header_css>
14
+ <tab>onlinepayment</tab>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>1000</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <groups>
21
+ <onlinepayment_group translate="label" module="onlinepayment">
22
+ <label>OnlinePayment General Configuration</label>
23
+ <frontend_type>text</frontend_type>
24
+ <sort_order>1000</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <fields>
29
+ <onlinepayment_merchant_id translate="label">
30
+ <label>Merchant Id</label>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>3</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>0</show_in_store>
36
+ <comment>In order to purchase this you need to sign a contract and insert the merchant ID received.</comment>
37
+ </onlinepayment_merchant_id>
38
+ <onlinepayment_username_live translate="label">
39
+ <label>Account username live</label>
40
+ <frontend_type>text</frontend_type>
41
+ <sort_order>4</sort_order>
42
+ <show_in_default>0</show_in_default>
43
+ <show_in_website>0</show_in_website>
44
+ <show_in_store>0</show_in_store>
45
+ </onlinepayment_username_live>
46
+ <onlinepayment_password_live translate="label">
47
+ <label>Account password live</label>
48
+ <frontend_type>text</frontend_type>
49
+ <sort_order>5</sort_order>
50
+ <show_in_default>0</show_in_default>
51
+ <show_in_website>0</show_in_website>
52
+ <show_in_store>0</show_in_store>
53
+ </onlinepayment_password_live>
54
+ <onlinepayment_username translate="label">
55
+ <label>Account username test</label>
56
+ <frontend_type>text</frontend_type>
57
+ <sort_order>6</sort_order>
58
+ <show_in_default>0</show_in_default>
59
+ <show_in_website>0</show_in_website>
60
+ <show_in_store>0</show_in_store>
61
+ </onlinepayment_username>
62
+ <onlinepayment_password translate="label">
63
+ <label>Account password test</label>
64
+ <frontend_type>text</frontend_type>
65
+ <sort_order>7</sort_order>
66
+ <show_in_default>0</show_in_default>
67
+ <show_in_website>0</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </onlinepayment_password>
70
+ <onlinepayment_css_url translate="label">
71
+ <label>Css URL</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>9</sort_order>
74
+ <show_in_default>0</show_in_default>
75
+ <show_in_website>0</show_in_website>
76
+ <show_in_store>0</show_in_store>
77
+ </onlinepayment_css_url>
78
+ <onlinepayment_prefix_order translate="label">
79
+ <label>TEST ONLY: Prefix order</label>
80
+ <frontend_type>text</frontend_type>
81
+ <sort_order>10</sort_order>
82
+ <show_in_default>0</show_in_default>
83
+ <show_in_website>0</show_in_website>
84
+ <show_in_store>0</show_in_store>
85
+ </onlinepayment_prefix_order>
86
+ </fields>
87
+ </onlinepayment_group>
88
+ </groups>
89
+ </onlinepayment>
90
+ <payment>
91
+ <groups>
92
+ <onlinepayment_hint>
93
+ <frontend_model>onlinepayment/adminhtml_system_config_notice</frontend_model>
94
+ <hint>
95
+ <template>onlinepayment/system/config/hint/payment_reference.phtml</template>
96
+ </hint>
97
+ <sort_order>669</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ </onlinepayment_hint>
102
+ <directpos_std translate="label" module="onlinepayment">
103
+ <label>OnlinePayment - FormularService Method</label>
104
+ <active>1</active>
105
+ <sort_order>670</sort_order>
106
+ <show_in_default>1</show_in_default>
107
+ <show_in_website>1</show_in_website>
108
+ <show_in_store>0</show_in_store>
109
+ <comment><![CDATA[To learn more about this payment method <a href="http://www.pay-it-easy.de/" target="_blank">click here</a>]]></comment>
110
+ <fields>
111
+ <active translate="label">
112
+ <label>Enabled</label>
113
+ <frontend_type>select</frontend_type>
114
+ <source_model>adminhtml/system_config_source_yesno</source_model>
115
+ <sort_order>1</sort_order>
116
+ <show_in_default>1</show_in_default>
117
+ <show_in_website>1</show_in_website>
118
+ <show_in_store>0</show_in_store>
119
+ </active>
120
+ <title translate="label">
121
+ <label>Title</label>
122
+ <frontend_type>text</frontend_type>
123
+ <sort_order>2</sort_order>
124
+ <show_in_default>1</show_in_default>
125
+ <show_in_website>1</show_in_website>
126
+ <show_in_store>0</show_in_store>
127
+ </title>
128
+ <mode translate="label">
129
+ <label>Test mode</label>
130
+ <frontend_type>select</frontend_type>
131
+ <source_model>adminhtml/system_config_source_yesno</source_model>
132
+ <sort_order>6</sort_order>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>1</show_in_website>
135
+ <show_in_store>0</show_in_store>
136
+ </mode>
137
+ <action>
138
+ <label>Action mode</label>
139
+ <frontend_type>select</frontend_type>
140
+ <source_model>onlinepayment/system_config_source_order_action</source_model>
141
+ <sort_order>7</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
+ </action>
146
+ </fields>
147
+ </directpos_std>
148
+ <directpos_cc translate="label" module="onlinepayment">
149
+ <label>OnlinePayment - Creditcard</label>
150
+ <sort_order>670</sort_order>
151
+ <show_in_default>1</show_in_default>
152
+ <show_in_website>1</show_in_website>
153
+ <show_in_store>0</show_in_store>
154
+ <fields>
155
+ <active translate="label">
156
+ <label>Enabled</label>
157
+ <frontend_type>select</frontend_type>
158
+ <source_model>adminhtml/system_config_source_yesno</source_model>
159
+ <sort_order>1</sort_order>
160
+ <show_in_default>1</show_in_default>
161
+ <show_in_website>1</show_in_website>
162
+ <show_in_store>0</show_in_store>
163
+ </active>
164
+ <title translate="label">
165
+ <label>Title</label>
166
+ <frontend_type>text</frontend_type>
167
+ <sort_order>2</sort_order>
168
+ <show_in_default>1</show_in_default>
169
+ <show_in_website>1</show_in_website>
170
+ <show_in_store>0</show_in_store>
171
+ </title>
172
+ <mode translate="label">
173
+ <label>Test mode</label>
174
+ <frontend_type>select</frontend_type>
175
+ <source_model>adminhtml/system_config_source_yesno</source_model>
176
+ <sort_order>6</sort_order>
177
+ <show_in_default>1</show_in_default>
178
+ <show_in_website>1</show_in_website>
179
+ <show_in_store>0</show_in_store>
180
+ </mode>
181
+ <action>
182
+ <label>Action mode</label>
183
+ <frontend_type>select</frontend_type>
184
+ <source_model>onlinepayment/system_config_source_order_action</source_model>
185
+ <sort_order>7</sort_order>
186
+ <show_in_default>1</show_in_default>
187
+ <show_in_website>1</show_in_website>
188
+ <show_in_store>0</show_in_store>
189
+ </action>
190
+ </fields>
191
+ </directpos_cc>
192
+ <directpos_elv translate="label" module="onlinepayment">
193
+ <label>OnlinePayment - Direct Debit</label>
194
+ <active>1</active>
195
+ <sort_order>680</sort_order>
196
+ <show_in_default>1</show_in_default>
197
+ <show_in_website>1</show_in_website>
198
+ <show_in_store>0</show_in_store>
199
+ <comment><![CDATA[To learn more about this payment method <a href="http://www.pay-it-easy.de/" target="_blank">click here</a>]]></comment>
200
+ <fields>
201
+ <active translate="label">
202
+ <label>Enabled</label>
203
+ <frontend_type>select</frontend_type>
204
+ <source_model>adminhtml/system_config_source_yesno</source_model>
205
+ <sort_order>1</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
+ </active>
210
+ <title translate="label">
211
+ <label>Title</label>
212
+ <frontend_type>text</frontend_type>
213
+ <sort_order>2</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
+ </title>
218
+ <mode translate="label">
219
+ <label>Test mode</label>
220
+ <frontend_type>select</frontend_type>
221
+ <source_model>adminhtml/system_config_source_yesno</source_model>
222
+ <sort_order>6</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>1</show_in_website>
225
+ <show_in_store>0</show_in_store>
226
+ </mode>
227
+ <action>
228
+ <label>Action mode</label>
229
+ <frontend_type>select</frontend_type>
230
+ <source_model>onlinepayment/system_config_source_order_action</source_model>
231
+ <sort_order>7</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>0</show_in_store>
235
+ </action>
236
+ </fields>
237
+ </directpos_elv>
238
+ </groups>
239
+ </payment>
240
+ </sections>
241
+ </config>
app/code/community/Payiteasy/Onlinepayment/sql/onlinepayment_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ /* @var $installer Mage_Core_Model_Resource_Setup */
5
+
6
+ $installer->startSetup();
7
+ $installer->run("ALTER TABLE `sales_flat_order` ADD `onlinepayment_status_update` TINYINT( 1 ) UNSIGNED NULL DEFAULT NULL ");
8
+ $installer->endSetup();
app/code/community/Payiteasy/Onlinepayment/sql/onlinepayment_setup/mysql4-upgrade-0.1.0-0.1.1.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ /* @var $installer Mage_Core_Model_Resource_Setup */
5
+
6
+ $installer->startSetup();
7
+ $paymentTable = $this->getTable('sales_flat_order_payment');
8
+ $quotePaymentTable = $this->getTable('sales_flat_quote_payment');
9
+ $configTable = $this->getTable('core_config_data');
10
+
11
+ /** used in reversal of payments, we need to hold the action mode of the payment (authorization or pre-authorization) */
12
+ $installer->run("ALTER TABLE `{$paymentTable}` ADD `onlinepayment_action_mode` VARCHAR( 32 ) NULL DEFAULT NULL");
13
+ $installer->run("ALTER TABLE `{$quotePaymentTable}` ADD `onlinepayment_action_mode` VARCHAR( 32 ) NULL DEFAULT NULL");
14
+
15
+ $installer->run("DELETE FROM {$configTable} WHERE path = 'payment/directpos_cc/order_status'");
16
+ $installer->run("DELETE FROM {$configTable} WHERE path = 'payment/directpos_elv/order_status'");
17
+ $installer->run("DELETE FROM {$configTable} WHERE path = 'payment/directpos_std/order_status'");
18
+
19
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/onlinepayment.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <layout>
2
+ <default>
3
+ <reference name="head">
4
+ <action method="addCss">
5
+ <name>onlinepayment/onlinepayment.css</name>
6
+ </action>
7
+ </reference>
8
+ </default>
9
+ <onlinepayment_adminhtml_information_index>
10
+ <reference name="content">
11
+ <block type="onlinepayment/adminhtml_information" name="onlinepayment_information" />
12
+ </reference>
13
+ </onlinepayment_adminhtml_information_index>
14
+ </layout>
app/design/adminhtml/default/default/template/onlinepayment/information/iframe.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package design_adminhtml_default_default
17
+ * @subpackage template
18
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
+ * @author Matthias Walter <info@noovias.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.noovias.com
22
+ */
23
+
24
+ /**
25
+ * @var $this Payone_Core_Block_Adminhtml_Information_Abstract
26
+ */
27
+ $url = $this->getPayiteasyUrl();
28
+ ?>
29
+ <div style="width:100%;">
30
+ <iframe src="<?php echo $url ?>" width="100%" frameborder="0" border="0"
31
+ style="min-height:1300px; height: 100%; overflow: hidden;">
32
+ </iframe>
33
+ </div>
app/design/adminhtml/default/default/template/onlinepayment/system/config/hint/payment_reference.phtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package design_adminhtml_default_default
17
+ * @subpackage template
18
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
+ * @author Matthias Walter <info@noovias.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.noovias.com
22
+ */
23
+ ?>
24
+ <?php
25
+ /**
26
+ * @var $this Payone_Core_Block_Adminhtml_System_Config_Hint
27
+ */
28
+ $title = Mage::helper('onlinepayment')->__('Looking for PayItEasy - OnlinePayment General Configuration? We have our own tab to the left.');
29
+ $link = Mage::helper('onlinepayment')->__('Go to PayItEasy - OnlinePayment Configuration Panel.');
30
+ $url = $this->getUrl('adminhtml/system_config/edit', array('section' => 'onlinepayment'));
31
+ ?>
32
+ <div class="payiteasy-payment-hint">
33
+ <h4><?php echo $title?></h4>
34
+
35
+ <p>
36
+ <a href="<?php echo $this->escapeHtml($url) ?>">
37
+ <?php echo $link ?>
38
+ </a>
39
+ </p>
40
+ </div>
app/design/frontend/base/default/layout/onlinepayment.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <checkout_onepage_index>
4
+ <reference name="head">
5
+ <block type="core/template" name="onlinepayment_protect" template="onlinepayment/protect.phtml" />
6
+ </reference>
7
+ </checkout_onepage_index>
8
+ </layout>
app/design/frontend/base/default/template/onlinepayment/creditcard_form.phtml ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 $_code=$this->getMethodCode();?>
28
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
29
+ <?php /*
30
+ <li>
31
+ <div class="input-box">
32
+ <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
33
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
34
+ </div>
35
+ </li>
36
+ */ ?>
37
+ <li>
38
+ <label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
39
+ <div class="input-box">
40
+ <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
41
+ <option value=""><?php echo $this->__('--Please Select--')?></option>
42
+ <?php $_ccType = $this->getInfoData('cc_type') ?>
43
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
44
+ <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
45
+ <?php endforeach ?>
46
+ </select>
47
+ </div>
48
+ </li>
49
+ <li>
50
+ <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
51
+ <div class="input-box">
52
+ <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
53
+ </div>
54
+ </li>
55
+ <li id="<?php echo $_code ?>_cc_type_exp_div">
56
+ <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
57
+ <div class="input-box">
58
+ <div class="v-fix">
59
+ <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
60
+ <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
61
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
62
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
63
+ <?php endforeach ?>
64
+ </select>
65
+ </div>
66
+ <div class="v-fix">
67
+ <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
68
+ <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
69
+ <?php foreach ($this->getCcYears() as $k=>$v): ?>
70
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
71
+ <?php endforeach ?>
72
+ </select>
73
+ </div>
74
+ </div>
75
+ </li>
76
+ <?php echo $this->getChildHtml() ?>
77
+ <?php if($this->hasVerification()): ?>
78
+ <li id="<?php echo $_code ?>_cc_type_cvv_div">
79
+ <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
80
+ <div class="input-box">
81
+ <div class="v-fix">
82
+ <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" />
83
+ </div>
84
+ <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
85
+ </div>
86
+ </li>
87
+ <?php endif; ?>
88
+
89
+ <?php if ($this->hasSsCardType()): ?>
90
+ <li id="<?php echo $_code ?>_cc_type_ss_div">
91
+ <ul class="inner-form">
92
+ <li class="form-alt"><label for="<?php echo $_code ?>_cc_issue" class="required"><em>*</em><?php echo $this->__('Switch/Solo/Maestro Only') ?></label></li>
93
+ <li>
94
+ <label for="<?php echo $_code ?>_cc_issue"><?php echo $this->__('Issue Number') ?>:</label>
95
+ <span class="input-box">
96
+ <input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text validate-cc-ukss cvv" id="<?php echo $_code ?>_cc_issue" name="payment[cc_ss_issue]" value="" />
97
+ </span>
98
+ </li>
99
+
100
+ <li>
101
+ <label for="<?php echo $_code ?>_start_month"><?php echo $this->__('Start Date') ?>:</label>
102
+ <div class="input-box">
103
+ <div class="v-fix">
104
+ <select id="<?php echo $_code ?>_start_month" name="payment[cc_ss_start_month]" class="validate-cc-ukss month">
105
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
106
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$this->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
107
+ <?php endforeach ?>
108
+ </select>
109
+ </div>
110
+ <div class="v-fix">
111
+ <select id="<?php echo $_code ?>_start_year" name="payment[cc_ss_start_year]" class="validate-cc-ukss year">
112
+ <?php foreach ($this->getSsStartYears() as $k=>$v): ?>
113
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$this->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
114
+ <?php endforeach ?>
115
+ </select>
116
+ </div>
117
+ </div>
118
+ </li>
119
+ <li class="adv-container">&nbsp;</li>
120
+ </ul>
121
+ <script type="text/javascript">
122
+ //<![CDATA[
123
+ var SSChecked<?php echo $_code ?> = function() {
124
+ var elm = $('<?php echo $_code ?>_cc_type');
125
+ if (['SS','SM','SO'].indexOf(elm.value) != -1) {
126
+ $('<?php echo $_code ?>_cc_type_ss_div').show();
127
+ } else {
128
+ $('<?php echo $_code ?>_cc_type_ss_div').hide();
129
+ }
130
+
131
+ Event.observe($('<?php echo $_code ?>_cc_type'), 'change', SSChecked<?php echo $_code ?>);
132
+ SSChecked<?php echo $_code(); ?>
133
+ //]]>
134
+ </script>
135
+ </li>
136
+ <?php endif; ?>
137
+ </ul>
app/design/frontend/base/default/template/onlinepayment/debit_form.phtml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_code = $this->getMethodCode(); ?>
2
+
3
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
4
+ <li>
5
+ <label for="<?php echo $_code ?>_bank_code" class="required">
6
+ <em>*</em><?php echo $this->__('Bank code') ?>
7
+ </label>
8
+
9
+ <div class="input-box">
10
+ <input type="text" id="<?php echo $_code ?>_bank_code" name="payment[debit_bank_code]"
11
+ title="<?php echo $this->__('Bank code') ?>"
12
+ class="input-text required-entry validate-debit-bank-code" value="" />
13
+ </div>
14
+ </li>
15
+ <li>
16
+ <label for="<?php echo $_code ?>_account_number"
17
+ class="required"><em>*</em><?php echo $this->__('Account Number') ?></label>
18
+
19
+ <div class="input-box">
20
+ <input type="text" id="<?php echo $_code ?>_account_number" name="payment[debit_account_number]"
21
+ title="<?php echo $this->__('Account Number') ?>"
22
+ class="input-text required-entry validate-debit-account-number" value=""/>
23
+ </div>
24
+ </li>
25
+ <li>
26
+ <label for="<?php echo $_code ?>_holder"><?php echo $this->__('Account Holder') ?></label>
27
+ <div class="input-box">
28
+ <input type="text" id="<?php echo $_code ?>_holder" name="payment[debit_holder]"
29
+ title="<?php echo $this->__('Account Holder') ?>"
30
+ class="input-text" value=""/>
31
+ </div>
32
+ </li>
33
+ </ul>
34
+ <script type="text/javascript">
35
+ Validation.add('validate-debit-bank-code', '<?php echo $this->__('Invalid bank code. The bank code must be a number and have exactly 8 digits.') ?>', function( fieldValue ) {
36
+ var test = new RegExp(/^[0-9]+$/);
37
+ if (!test.match( fieldValue ) || fieldValue.length !== 8) {
38
+ return false;
39
+ }
40
+
41
+ return true;
42
+ } );
43
+ Validation.add('validate-debit-account-number', '<?php echo $this->__('Invalid account number. The account number must contain maximum 10 digits.') ?>', function( fieldValue ) {
44
+ var test = new RegExp(/^[0-9]+$/);
45
+ if (!test.match( fieldValue ) || fieldValue.length > 10) {
46
+ return false;
47
+ }
48
+
49
+ return true;
50
+ } );
51
+ </script>
app/design/frontend/base/default/template/onlinepayment/form.phtml ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 $_code=$this->getMethodCode();?>
28
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
29
+ <?php /*
30
+ <li>
31
+ <div class="input-box">
32
+ <label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
33
+ <input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
34
+ </div>
35
+ </li>
36
+ */ ?>
37
+ <li>
38
+ <label for="<?php echo $_code ?>_cc_type" class="required"><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
39
+ <div class="input-box">
40
+ <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select">
41
+ <option value=""><?php echo $this->__('--Please Select--')?></option>
42
+ <?php $_ccType = $this->getInfoData('cc_type') ?>
43
+ <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
44
+ <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
45
+ <?php endforeach ?>
46
+ </select>
47
+ </div>
48
+ </li>
49
+ <li>
50
+ <label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
51
+ <div class="input-box">
52
+ <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
53
+ </div>
54
+ </li>
55
+ <li id="<?php echo $_code ?>_cc_type_exp_div">
56
+ <label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
57
+ <div class="input-box">
58
+ <div class="v-fix">
59
+ <select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
60
+ <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
61
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
62
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
63
+ <?php endforeach ?>
64
+ </select>
65
+ </div>
66
+ <div class="v-fix">
67
+ <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
68
+ <select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
69
+ <?php foreach ($this->getCcYears() as $k=>$v): ?>
70
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
71
+ <?php endforeach ?>
72
+ </select>
73
+ </div>
74
+ </div>
75
+ </li>
76
+ <?php echo $this->getChildHtml() ?>
77
+ <?php if($this->hasVerification()): ?>
78
+ <li id="<?php echo $_code ?>_cc_type_cvv_div">
79
+ <label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
80
+ <div class="input-box">
81
+ <div class="v-fix">
82
+ <input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" />
83
+ </div>
84
+ <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
85
+ </div>
86
+ </li>
87
+ <?php endif; ?>
88
+
89
+ <?php if ($this->hasSsCardType()): ?>
90
+ <li id="<?php echo $_code ?>_cc_type_ss_div">
91
+ <ul class="inner-form">
92
+ <li class="form-alt"><label for="<?php echo $_code ?>_cc_issue" class="required"><em>*</em><?php echo $this->__('Switch/Solo/Maestro Only') ?></label></li>
93
+ <li>
94
+ <label for="<?php echo $_code ?>_cc_issue"><?php echo $this->__('Issue Number') ?>:</label>
95
+ <span class="input-box">
96
+ <input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text validate-cc-ukss cvv" id="<?php echo $_code ?>_cc_issue" name="payment[cc_ss_issue]" value="" />
97
+ </span>
98
+ </li>
99
+
100
+ <li>
101
+ <label for="<?php echo $_code ?>_start_month"><?php echo $this->__('Start Date') ?>:</label>
102
+ <div class="input-box">
103
+ <div class="v-fix">
104
+ <select id="<?php echo $_code ?>_start_month" name="payment[cc_ss_start_month]" class="validate-cc-ukss month">
105
+ <?php foreach ($this->getCcMonths() as $k=>$v): ?>
106
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$this->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
107
+ <?php endforeach ?>
108
+ </select>
109
+ </div>
110
+ <div class="v-fix">
111
+ <select id="<?php echo $_code ?>_start_year" name="payment[cc_ss_start_year]" class="validate-cc-ukss year">
112
+ <?php foreach ($this->getSsStartYears() as $k=>$v): ?>
113
+ <option value="<?php echo $k?$k:'' ?>"<?php if($k==$this->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
114
+ <?php endforeach ?>
115
+ </select>
116
+ </div>
117
+ </div>
118
+ </li>
119
+ <li class="adv-container">&nbsp;</li>
120
+ </ul>
121
+ <script type="text/javascript">
122
+ //<![CDATA[
123
+ var SSChecked<?php echo $_code ?> = function() {
124
+ var elm = $('<?php echo $_code ?>_cc_type');
125
+ if (['SS','SM','SO'].indexOf(elm.value) != -1) {
126
+ $('<?php echo $_code ?>_cc_type_ss_div').show();
127
+ } else {
128
+ $('<?php echo $_code ?>_cc_type_ss_div').hide();
129
+ }
130
+
131
+ Event.observe($('<?php echo $_code ?>_cc_type'), 'change', SSChecked<?php echo $_code ?>);
132
+ SSChecked<?php echo $_code(); ?>
133
+ //]]>
134
+ </script>
135
+ </li>
136
+ <?php endif; ?>
137
+ </ul>
app/design/frontend/base/default/template/onlinepayment/protect.phtml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $url = $this->getUrl('onlinepayment/checkout_onepage/savePayment', array('_secure'=>true));
3
+ ?>
4
+ <script type="text/javascript">
5
+ //<![CDATA[
6
+ Event.observe(window, 'load', function () {
7
+ payment.saveUrl = '<?php echo $url ?>';
8
+ });
9
+
10
+
11
+ //]]>
12
+ </script>
app/design/frontend/base/default/template/onlinepayment/standard/redirect.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $order = new Mage_Sales_Model_Order();
4
+ $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
5
+ $order->loadByIncrementId($orderId);
6
+
7
+ Mage::getModel('onlinepayment/method_standard')->buildRequest($order);
8
+ ?>
app/etc/modules/Payiteasy_Onlinepayment.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Payiteasy_Onlinepayment>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Payiteasy_Onlinepayment>
8
+ </modules>
9
+ </config>
app/locale/de_DE/Payiteasy_Onlinepayment.csv ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Payment updating error.", "Payment updating error."
2
+ "Some transaction problems caused this order to change it's status to cancelled.", "Some transaction problems caused this order to change it's status to cancelled."
3
+ "Payment success.", "Payment success."
4
+ "Client redirected to OnlinePayment Gateway", "Client redirected to OnlinePayment Gateway"
5
+ "Error occured while redirecting to Gateway.", "Error occured while redirecting to Gateway."
6
+ "Client came back to website after paying.", "Client came back to website after paying."
7
+ "Looking for PayItEasy - OnlinePayment General Configuration? We have our own tab to the left.", "Looking for PayItEasy - OnlinePayment General Configuration? We have our own tab to the left."
8
+ "Go to PayItEasy - OnlinePayment Configuration Panel.", "Go to PayItEasy - OnlinePayment Configuration Panel."
9
+ "Learn more about this Payment Method", "Learn more about this Payment Method"
10
+ "OnlinePayment Configuration", "OnlinePayment Configuration"
11
+ "OnlinePayment General Configuration", "OnlinePayment General Configuration"
12
+ "Merchant Id", "Merchant Id"
13
+ "Account username", "Account username"
14
+ "Account password", "Account password"
15
+ "TEST ONLY: Prefix order", "TEST ONLY: Prefix order"
app/locale/en_US/Payiteasy_Onlinepayment.csv ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Payment updating error.", "Payment updating error."
2
+ "Some transaction problems caused this order to change it's status to cancelled.", "Some transaction problems caused this order to change it's status to cancelled."
3
+ "Payment success.", "Payment success."
4
+ "Client redirected to OnlinePayment Gateway", "Client redirected to OnlinePayment Gateway"
5
+ "Error occured while redirecting to Gateway.", "Error occured while redirecting to Gateway."
6
+ "Client came back to website after paying.", "Client came back to website after paying."
7
+ "Looking for PayItEasy - OnlinePayment General Configuration? We have our own tab to the left.", "Looking for PayItEasy - OnlinePayment General Configuration? We have our own tab to the left."
8
+ "Go to PayItEasy - OnlinePayment Configuration Panel.", "Go to PayItEasy - OnlinePayment Configuration Panel."
9
+ "Learn more about this Payment Method", "Learn more about this Payment Method"
10
+ "OnlinePayment Configuration", "OnlinePayment Configuration"
11
+ "OnlinePayment General Configuration", "OnlinePayment General Configuration"
12
+ "Merchant Id", "Merchant Id"
13
+ "Account username", "Account username"
14
+ "Account password", "Account password"
15
+ "TEST ONLY: Prefix order", "TEST ONLY: Prefix order"
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>PayItEasy</name>
4
+ <version>0.1.1</version>
5
+ <stability>stable</stability>
6
+ <license>free</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>PayItEasy Online Payment Integration</summary>
10
+ <description>This extension provides online payment ingretation through PayItEasy Gateway</description>
11
+ <notes>Notes</notes>
12
+ <authors><author><name>Jason Altehoefer </name><user>Jason</user><email>jason.altehoefer@firstfinance-gmbh.de</email></author></authors>
13
+ <date>2013-06-20</date>
14
+ <time>15:01:02</time>
15
+ <contents><target name="magecommunity"><dir name="Payiteasy"><dir name="Onlinepayment"><dir name="Block"><dir name="Adminhtml"><dir name="Information"><file name="Abstract.php" hash="386d771935119c77406270c62fa7e0ea"/></dir><file name="Information.php" hash="b52aaba393ed596b7d5d8d07d58e4898"/><dir name="System"><dir name="Config"><file name="Notice.php" hash="af738096b44868233ef1f2d0dd11df33"/></dir></dir></dir><dir name="Creditcard"><file name="Form.php" hash="fe953dee8780ae9883e6573824f13c26"/><file name="Redirect.php" hash="8ad136902815899568aabedf7fc5a04d"/></dir><dir name="Debit"><file name="Form.php" hash="6f9edc0eca1a28b9450aae41aab75f3a"/></dir><dir name="Standard"><file name="Redirect.php" hash="8d73fb7be3a2089219d271ded390162b"/></dir></dir><dir name="Helper"><file name="Data.php" hash="400fd4267a6d53f4f3b7190c7be33271"/></dir><dir name="Model"><dir name="ApiRequest"><file name="Base.php" hash="f148be44e23ebb5d65414d7ac4a4d767"/><file name="Capture.php" hash="065e2b709b57bed3c63e533420f03c6f"/><file name="Debit.php" hash="f5e2417511fc78d7b670d734557f218e"/><file name="Refund.php" hash="aef0dc3a63298d76e3d57e4d82904bf3"/><dir name="Type"><file name="Payment.php" hash="357a4f361ce15925062ddb7c18a396f3"/></dir></dir><dir name="Method"><file name="Abstract.php" hash="278ca256afde016a75a4fbf5a0b45783"/><file name="Creditcard.php" hash="6d0beb35435c491913a471ad3fc6d7a4"/><file name="Debit.php" hash="9215059e81c6017fd7a828da25abc5ce"/><file name="Standard.php" hash="304e0a4b3215742c6f05aacc45f7a5aa"/></dir><file name="Observer.php" hash="f7cbba5fdb49b62ec1eea03dcb4c7e28"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Order"><file name="Action.php" hash="e7b05b90b5879d10678c989551176424"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="InformationController.php" hash="7c9fc8aff3311c4b0b3f97690668a5d3"/></dir><dir name="Checkout"><file name="OnepageController.php" hash="cfabbdee3bce4aa5817e12b2cb7e06d7"/></dir><file name="PaymentController.php" hash="0e6d3188854cc5eb2d1b19ea7b4aa75a"/></dir><dir name="etc"><file name="config.xml" hash="877d92dec7358858aa30b1ff7c6bce75"/><file name="system.xml" hash="5ea681ec95364cd90b0d2655a5cdaff7"/></dir><dir name="sql"><dir name="onlinepayment_setup"><file name="mysql4-install-0.1.0.php" hash="ba06c75b33a8ead0dcc95c76feed91cf"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="59e0a7da7080fabfeb4617c3b72eb13e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="onlinepayment"><dir name="images"><file name="payiteasy_logo.png" hash="25ad5daf5fb9f19809a557d427ce9dc1"/><file name="pie_mascot.png" hash="eee0cd15f09ea261cffa80786634be7e"/></dir><file name="onlinepayment.css" hash="28dafb5651413996b6fe57f6cd58b784"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="directpos"><file name="custom.css" hash="be4efe64fe53ecf1ce7e73cc811cead1"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="onlinepayment.xml" hash="a66f625078b8e458579cd631fc5f1c4d"/></dir><dir name="template"><dir name="onlinepayment"><file name="creditcard_form.phtml" hash="3e5fcd6a08150eb5fb5bf8fadeeaa5a4"/><file name="debit_form.phtml" hash="6ae76d0a8a43b4a872b6203124f7b8c2"/><file name="form.phtml" hash="3e5fcd6a08150eb5fb5bf8fadeeaa5a4"/><file name="protect.phtml" hash="9023968c86436b6e03addcd177a737f6"/><dir name="standard"><file name="redirect.phtml" hash="f01c61dfdb380d32a36985d582332a4b"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="onlinepayment.xml" hash="bc12bb7c199267240147f771a1f38d58"/></dir><dir name="template"><dir name="onlinepayment"><dir name="information"><file name="iframe.phtml" hash="14bb8faa7a701eef27ebb7561b7badd0"/></dir><dir name="system"><dir name="config"><dir name="hint"><file name="payment_reference.phtml" hash="762d6e8ab4d72552baeb5701a721483e"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Payiteasy_Onlinepayment.xml" hash="dd479a831ff37225c97ae5addfe5eb34"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Payiteasy_Onlinepayment.csv" hash="4adcebcbcb35f5e0d77196df7469e999"/></dir><dir name="en_US"><file name="Payiteasy_Onlinepayment.csv" hash="4adcebcbcb35f5e0d77196df7469e999"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/onlinepayment/images/payiteasy_logo.png ADDED
Binary file
skin/adminhtml/default/default/onlinepayment/images/pie_mascot.png ADDED
Binary file
skin/adminhtml/default/default/onlinepayment/onlinepayment.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ li.tab-payiteasy dl dt {
2
+ background: url("images/pie_mascot.png") no-repeat scroll 1px 1px #D1DEDF;;
3
+ padding-left: 24px;
4
+ }
5
+
6
+
7
+ h3.payiteasy-config-header {
8
+ background: url("images/pie_mascot.png") no-repeat top left;
9
+ color: #003B59;
10
+ padding: 0 25px;
11
+ line-height: 19px;
12
+ height: 19px;
13
+ }
14
+
15
+ .payiteasy-payment-hint {
16
+ background: url("images/payiteasy_logo.png") no-repeat scroll 5px 5px #FFFFFF;
17
+ border: 1px solid #CCCCCC;
18
+ margin-bottom: 15px;
19
+ margin: 5px 0;
20
+ padding: 7px 10px 10px 200px;
21
+ }
skin/frontend/base/default/css/directpos/custom.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ body {
2
+
3
+ }