Paymill_Paymill - Version 3.1.0

Version Notes

* ensure that a token exist
* payment form styling

Download this release

Release Info

Developer PayIntelligent
Extension Paymill_Paymill
Version 3.1.0
Comparing to
See all releases


Code changes from version 3.0.6 to 3.1.0

Files changed (59) hide show
  1. app/code/community/Paymill/Paymill/Block/Adminhtml/Log.php +43 -43
  2. app/code/community/Paymill/Paymill/Block/Adminhtml/Log/Grid.php +138 -138
  3. app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormCreditcard.php +59 -59
  4. app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormDirectdebit.php +33 -33
  5. app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormCreditcard.php +52 -52
  6. app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormDirectdebit.php +52 -52
  7. app/code/community/Paymill/Paymill/Helper/CustomerHelper.php +65 -65
  8. app/code/community/Paymill/Paymill/Helper/Data.php +119 -119
  9. app/code/community/Paymill/Paymill/Helper/FastCheckoutHelper.php +90 -90
  10. app/code/community/Paymill/Paymill/Helper/LoggingHelper.php +49 -49
  11. app/code/community/Paymill/Paymill/Helper/OptionHelper.php +135 -135
  12. app/code/community/Paymill/Paymill/Helper/PaymentHelper.php +281 -281
  13. app/code/community/Paymill/Paymill/Helper/RefundHelper.php +85 -85
  14. app/code/community/Paymill/Paymill/Helper/TransactionHelper.php +96 -96
  15. app/code/community/Paymill/Paymill/Model/Fastcheckout.php +136 -136
  16. app/code/community/Paymill/Paymill/Model/Log.php +51 -51
  17. app/code/community/Paymill/Paymill/Model/Method/MethodModelAbstract.php +252 -249
  18. app/code/community/Paymill/Paymill/Model/Method/MethodModelCreditcard.php +135 -130
  19. app/code/community/Paymill/Paymill/Model/Method/MethodModelDirectdebit.php +45 -45
  20. app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout.php +29 -29
  21. app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout/Collection.php +29 -29
  22. app/code/community/Paymill/Paymill/Model/Mysql4/Log.php +29 -29
  23. app/code/community/Paymill/Paymill/Model/Mysql4/Log/Collection.php +29 -29
  24. app/code/community/Paymill/Paymill/Model/Observer.php +73 -73
  25. app/code/community/Paymill/Paymill/Model/TransactionData.php +62 -62
  26. app/code/community/Paymill/Paymill/controllers/Adminhtml/LogController.php +67 -67
  27. app/code/community/Paymill/Paymill/etc/adminhtml.xml +15 -15
  28. app/code/community/Paymill/Paymill/etc/config.xml +161 -161
  29. app/code/community/Paymill/Paymill/etc/system.xml +243 -243
  30. app/code/community/Paymill/Paymill/sql/paymill_setup/mysql4-install-3.0.0.php +45 -45
  31. app/design/adminhtml/base/default/layout/paymill.xml +12 -12
  32. app/design/adminhtml/base/default/template/paymill/payment/info/creditcard.phtml +13 -13
  33. app/design/adminhtml/base/default/template/paymill/payment/info/directdebit.phtml +13 -13
  34. app/design/frontend/base/default/template/paymill/payment/form/creditcard.phtml +64 -63
  35. app/design/frontend/base/default/template/paymill/payment/form/directdebit.phtml +41 -41
  36. app/design/frontend/base/default/template/paymill/payment/info/creditcard.phtml +5 -5
  37. app/design/frontend/base/default/template/paymill/payment/info/directdebit.phtml +5 -5
  38. app/etc/modules/Paymill_Paymill.xml +16 -16
  39. app/locale/de_DE/Paymill_Paymill.csv +56 -55
  40. app/locale/en_GB/Paymill_Paymill.csv +56 -55
  41. app/locale/en_US/Paymill_Paymill.csv +55 -55
  42. js/paymill/paymentForm.js +245 -245
  43. lib/Services/Paymill/Apiclient/Curl.php +158 -158
  44. lib/Services/Paymill/Apiclient/Interface.php +19 -19
  45. lib/Services/Paymill/Apiclient/paymill.crt +25 -25
  46. lib/Services/Paymill/Base.php +144 -144
  47. lib/Services/Paymill/Clients.php +13 -13
  48. lib/Services/Paymill/Exception.php +16 -16
  49. lib/Services/Paymill/LoggingInterface.php +14 -14
  50. lib/Services/Paymill/Offers.php +13 -13
  51. lib/Services/Paymill/PaymentProcessor.php +548 -548
  52. lib/Services/Paymill/Payments.php +26 -26
  53. lib/Services/Paymill/Preauthorizations.php +26 -26
  54. lib/Services/Paymill/Refunds.php +55 -55
  55. lib/Services/Paymill/Subscriptions.php +13 -13
  56. lib/Services/Paymill/Transactions.php +39 -39
  57. lib/Services/Paymill/Webhooks.php +13 -13
  58. package.xml +7 -12
  59. skin/frontend/base/default/css/paymill/logo.css +16 -16
app/code/community/Paymill/Paymill/Block/Adminhtml/Log.php CHANGED
@@ -1,44 +1,44 @@
1
- <?php
2
-
3
- /**
4
- * Magento
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * that is bundled with this package in the file LICENSE.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
22
- {
23
-
24
- /**
25
- * Construct
26
- */
27
- public function __construct()
28
- {
29
- $this->_blockGroup = 'paymill';
30
- $this->_controller = 'adminhtml_log';
31
- $this->_headerText = Mage::helper('paymill')->__('paymill_log');
32
- parent::__construct();
33
- }
34
-
35
- /**
36
- * @see Mage_Adminhtml_Block_Widget_Grid_Container::_prepareLayout()
37
- */
38
- protected function _prepareLayout()
39
- {
40
- $this->_removeButton('add');
41
- return parent::_prepareLayout();
42
- }
43
-
44
  }
1
+ <?php
2
+
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
22
+ {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ public function __construct()
28
+ {
29
+ $this->_blockGroup = 'paymill';
30
+ $this->_controller = 'adminhtml_log';
31
+ $this->_headerText = Mage::helper('paymill')->__('paymill_log');
32
+ parent::__construct();
33
+ }
34
+
35
+ /**
36
+ * @see Mage_Adminhtml_Block_Widget_Grid_Container::_prepareLayout()
37
+ */
38
+ protected function _prepareLayout()
39
+ {
40
+ $this->_removeButton('add');
41
+ return parent::_prepareLayout();
42
+ }
43
+
44
  }
app/code/community/Paymill/Paymill/Block/Adminhtml/Log/Grid.php CHANGED
@@ -1,138 +1,138 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
22
- {
23
-
24
- /**
25
- * Is filter allowed
26
- *
27
- * @var boolean
28
- */
29
- protected $_isFilterAllowed = true;
30
-
31
- /**
32
- * Is sortable
33
- *
34
- * @var boolean
35
- */
36
- protected $_isSortable = true;
37
-
38
- /**
39
- * Construct
40
- */
41
- public function __construct()
42
- {
43
- parent::__construct();
44
- $this->setId('log_grid');
45
- $this->setDefaultSort('id');
46
- $this->setDefaultDir('DESC');
47
- $this->setSaveParametersInSession(true);
48
- }
49
-
50
- /**
51
- * Is filter allowed
52
- */
53
- protected function _isFilterAllowed()
54
- {
55
- return $this->_isFilterAllowed;
56
- }
57
-
58
- /**
59
- * Is sortable
60
- */
61
- protected function _isSortable()
62
- {
63
- return $this->_isSortable;
64
- }
65
-
66
- /**
67
- * Retrive massaction block
68
- *
69
- * @return Mage_Adminhtml_Block_Widget_Grid_Massaction
70
- */
71
- public function getMassactionBlock()
72
- {
73
- return $this->getChild('massaction')->setErrorText(Mage::helper('paymill')->__('paymill_error_text_no_entry_selected'));
74
- }
75
-
76
- /**
77
- * Prepare Collection
78
- *
79
- * @return Paymill_Paymill_Block_Adminhtml_Log_Grid
80
- */
81
- protected function _prepareCollection()
82
- {
83
- $collection = Mage::getModel('paymill/log')->getCollection();
84
- $this->setCollection($collection);
85
- return parent::_prepareCollection();
86
- }
87
-
88
- /**
89
- * Prepare Columns
90
- *
91
- * @return Paymill_Paymill_Block_Adminhtml_Log_Grid
92
- */
93
- protected function _prepareColumns()
94
- {
95
- $this->addColumn('entry_date', array(
96
- 'header' => Mage::helper('paymill')->__('paymill_backend_log_entry_date'),
97
- 'index' => 'entry_date',
98
- ));
99
- $this->addColumn('version', array(
100
- 'header' => Mage::helper('paymill')->__('paymill_backend_log_version'),
101
- 'index' => 'version',
102
- ));
103
- $this->addColumn('merchant_info', array(
104
- 'header' => Mage::helper('paymill')->__('paymill_backend_log_merchant_info'),
105
- 'index' => 'merchant_info',
106
- ));
107
- $this->addColumn('dev_info', array(
108
- 'header' => Mage::helper('paymill')->__('paymill_backend_log_dev_info'),
109
- 'index' => 'dev_info',
110
- ));
111
- $this->addColumn('dev_info_additional', array(
112
- 'header' => Mage::helper('paymill')->__('paymill_backend_log_dev_info_additional'),
113
- 'index' => 'dev_info_additional',
114
- ));
115
-
116
- return parent::_prepareColumns();
117
- }
118
-
119
- /**
120
- * Prepares Massaction for deletion of Logentries
121
- *
122
- * @return Paymill_Paymill_Block_Adminhtml_Log_Grid
123
- */
124
- protected function _prepareMassaction()
125
- {
126
- $this->setMassactionIdField('id');
127
- $this->getMassactionBlock()->setFormFieldName('log_id');
128
-
129
- $this->getMassactionBlock()->addItem('delete', array(
130
- 'label' => Mage::helper('paymill')->__('paymill_action_delete'),
131
- 'url' => $this->getUrl('*/*/massDelete'),
132
- 'confirm' => Mage::helper('paymill')->__('paymill_dialog_confirm'),
133
- ));
134
-
135
- return $this;
136
- }
137
-
138
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
22
+ {
23
+
24
+ /**
25
+ * Is filter allowed
26
+ *
27
+ * @var boolean
28
+ */
29
+ protected $_isFilterAllowed = true;
30
+
31
+ /**
32
+ * Is sortable
33
+ *
34
+ * @var boolean
35
+ */
36
+ protected $_isSortable = true;
37
+
38
+ /**
39
+ * Construct
40
+ */
41
+ public function __construct()
42
+ {
43
+ parent::__construct();
44
+ $this->setId('log_grid');
45
+ $this->setDefaultSort('id');
46
+ $this->setDefaultDir('DESC');
47
+ $this->setSaveParametersInSession(true);
48
+ }
49
+
50
+ /**
51
+ * Is filter allowed
52
+ */
53
+ protected function _isFilterAllowed()
54
+ {
55
+ return $this->_isFilterAllowed;
56
+ }
57
+
58
+ /**
59
+ * Is sortable
60
+ */
61
+ protected function _isSortable()
62
+ {
63
+ return $this->_isSortable;
64
+ }
65
+
66
+ /**
67
+ * Retrive massaction block
68
+ *
69
+ * @return Mage_Adminhtml_Block_Widget_Grid_Massaction
70
+ */
71
+ public function getMassactionBlock()
72
+ {
73
+ return $this->getChild('massaction')->setErrorText(Mage::helper('paymill')->__('paymill_error_text_no_entry_selected'));
74
+ }
75
+
76
+ /**
77
+ * Prepare Collection
78
+ *
79
+ * @return Paymill_Paymill_Block_Adminhtml_Log_Grid
80
+ */
81
+ protected function _prepareCollection()
82
+ {
83
+ $collection = Mage::getModel('paymill/log')->getCollection();
84
+ $this->setCollection($collection);
85
+ return parent::_prepareCollection();
86
+ }
87
+
88
+ /**
89
+ * Prepare Columns
90
+ *
91
+ * @return Paymill_Paymill_Block_Adminhtml_Log_Grid
92
+ */
93
+ protected function _prepareColumns()
94
+ {
95
+ $this->addColumn('entry_date', array(
96
+ 'header' => Mage::helper('paymill')->__('paymill_backend_log_entry_date'),
97
+ 'index' => 'entry_date',
98
+ ));
99
+ $this->addColumn('version', array(
100
+ 'header' => Mage::helper('paymill')->__('paymill_backend_log_version'),
101
+ 'index' => 'version',
102
+ ));
103
+ $this->addColumn('merchant_info', array(
104
+ 'header' => Mage::helper('paymill')->__('paymill_backend_log_merchant_info'),
105
+ 'index' => 'merchant_info',
106
+ ));
107
+ $this->addColumn('dev_info', array(
108
+ 'header' => Mage::helper('paymill')->__('paymill_backend_log_dev_info'),
109
+ 'index' => 'dev_info',
110
+ ));
111
+ $this->addColumn('dev_info_additional', array(
112
+ 'header' => Mage::helper('paymill')->__('paymill_backend_log_dev_info_additional'),
113
+ 'index' => 'dev_info_additional',
114
+ ));
115
+
116
+ return parent::_prepareColumns();
117
+ }
118
+
119
+ /**
120
+ * Prepares Massaction for deletion of Logentries
121
+ *
122
+ * @return Paymill_Paymill_Block_Adminhtml_Log_Grid
123
+ */
124
+ protected function _prepareMassaction()
125
+ {
126
+ $this->setMassactionIdField('id');
127
+ $this->getMassactionBlock()->setFormFieldName('log_id');
128
+
129
+ $this->getMassactionBlock()->addItem('delete', array(
130
+ 'label' => Mage::helper('paymill')->__('paymill_action_delete'),
131
+ 'url' => $this->getUrl('*/*/massDelete'),
132
+ 'confirm' => Mage::helper('paymill')->__('paymill_dialog_confirm'),
133
+ ));
134
+
135
+ return $this;
136
+ }
137
+
138
+ }
app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormCreditcard.php CHANGED
@@ -1,59 +1,59 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Block_Payment_Form_PaymentFormCreditcard extends Mage_Payment_Block_Form
22
- {
23
-
24
- /**
25
- * Construct
26
- */
27
- protected function _construct()
28
- {
29
- parent::_construct();
30
- $this->setTemplate('paymill/payment/form/creditcard.phtml');
31
- }
32
-
33
- /**
34
- * Retrieve credit card expire months for Paymill
35
- *
36
- * @return array
37
- */
38
- public function getPaymillCcMonths()
39
- {
40
- $months[0] = $this->__('Month');
41
- $months = array_merge($months, Mage::getSingleton('payment/config')->getMonths());
42
-
43
- return $months;
44
- }
45
-
46
- /**
47
- * Retrieve credit card expire years for Paymill
48
- *
49
- * @return array
50
- */
51
- public function getPaymillCcYears()
52
- {
53
- $years = Mage::getSingleton('payment/config')->getYears();
54
- $years = array(0 => $this->__('Year')) + $years;
55
-
56
- return $years;
57
- }
58
-
59
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Block_Payment_Form_PaymentFormCreditcard extends Mage_Payment_Block_Form
22
+ {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ protected function _construct()
28
+ {
29
+ parent::_construct();
30
+ $this->setTemplate('paymill/payment/form/creditcard.phtml');
31
+ }
32
+
33
+ /**
34
+ * Retrieve credit card expire months for Paymill
35
+ *
36
+ * @return array
37
+ */
38
+ public function getPaymillCcMonths()
39
+ {
40
+ $months[0] = $this->__('Month');
41
+ $months = array_merge($months, Mage::getSingleton('payment/config')->getMonths());
42
+
43
+ return $months;
44
+ }
45
+
46
+ /**
47
+ * Retrieve credit card expire years for Paymill
48
+ *
49
+ * @return array
50
+ */
51
+ public function getPaymillCcYears()
52
+ {
53
+ $years = Mage::getSingleton('payment/config')->getYears();
54
+ $years = array(0 => $this->__('Year')) + $years;
55
+
56
+ return $years;
57
+ }
58
+
59
+ }
app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormDirectdebit.php CHANGED
@@ -1,33 +1,33 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Block_Payment_Form_PaymentFormDirectdebit extends Mage_Payment_Block_Form
22
- {
23
-
24
- /**
25
- * Construct
26
- */
27
- protected function _construct()
28
- {
29
- parent::_construct();
30
- $this->setTemplate('paymill/payment/form/directdebit.phtml');
31
- }
32
-
33
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Block_Payment_Form_PaymentFormDirectdebit extends Mage_Payment_Block_Form
22
+ {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ protected function _construct()
28
+ {
29
+ parent::_construct();
30
+ $this->setTemplate('paymill/payment/form/directdebit.phtml');
31
+ }
32
+
33
+ }
app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormCreditcard.php CHANGED
@@ -1,52 +1,52 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Block_Payment_Info_PaymentFormCreditcard extends Mage_Payment_Block_Info
22
- {
23
-
24
- /**
25
- * Construct
26
- */
27
- protected function _construct()
28
- {
29
- parent::_construct();
30
- $this->setTemplate('paymill/payment/info/creditcard.phtml');
31
- }
32
-
33
- /**
34
- * Add custom information to payment method information
35
- *
36
- * @param Varien_Object|array $transport
37
- */
38
- protected function _prepareSpecificInformation($transport = null)
39
- {
40
- if (null !== $this->_paymentSpecificInformation) {
41
- return $this->_paymentSpecificInformation;
42
- }
43
- $transport = parent::_prepareSpecificInformation($transport);
44
-
45
- $data = array();
46
- $data['paymillTransactionId'] = $this->getInfo()->getAdditionalInformation('paymillTransactionId');
47
- $data['imgUrl'] = Mage::helper('paymill')->getImagePath() . "icon_paymill.png";
48
-
49
- return $transport->setData(array_merge($data, $transport->getData()));
50
- }
51
-
52
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Block_Payment_Info_PaymentFormCreditcard extends Mage_Payment_Block_Info
22
+ {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ protected function _construct()
28
+ {
29
+ parent::_construct();
30
+ $this->setTemplate('paymill/payment/info/creditcard.phtml');
31
+ }
32
+
33
+ /**
34
+ * Add custom information to payment method information
35
+ *
36
+ * @param Varien_Object|array $transport
37
+ */
38
+ protected function _prepareSpecificInformation($transport = null)
39
+ {
40
+ if (null !== $this->_paymentSpecificInformation) {
41
+ return $this->_paymentSpecificInformation;
42
+ }
43
+ $transport = parent::_prepareSpecificInformation($transport);
44
+
45
+ $data = array();
46
+ $data['paymillTransactionId'] = $this->getInfo()->getAdditionalInformation('paymillTransactionId');
47
+ $data['imgUrl'] = Mage::helper('paymill')->getImagePath() . "icon_paymill.png";
48
+
49
+ return $transport->setData(array_merge($data, $transport->getData()));
50
+ }
51
+
52
+ }
app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormDirectdebit.php CHANGED
@@ -1,52 +1,52 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Block_Payment_Info_PaymentFormDirectdebit extends Mage_Payment_Block_Info
22
- {
23
-
24
- /**
25
- * Construct
26
- */
27
- protected function _construct()
28
- {
29
- parent::_construct();
30
- $this->setTemplate('paymill/payment/info/directdebit.phtml');
31
- }
32
-
33
- /**
34
- * Add custom information to payment method information
35
- *
36
- * @param Varien_Object|array $transport
37
- */
38
- protected function _prepareSpecificInformation($transport = null)
39
- {
40
- if (null !== $this->_paymentSpecificInformation) {
41
- return $this->_paymentSpecificInformation;
42
- }
43
- $transport = parent::_prepareSpecificInformation($transport);
44
-
45
- $data = array();
46
- $data['paymillTransactionId'] = $this->getInfo()->getAdditionalInformation('paymillTransactionId');
47
- $data['imgUrl'] = Mage::helper('paymill')->getImagePath() . "icon_paymill.png";
48
-
49
- return $transport->setData(array_merge($data, $transport->getData()));
50
- }
51
-
52
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Block_Payment_Info_PaymentFormDirectdebit extends Mage_Payment_Block_Info
22
+ {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ protected function _construct()
28
+ {
29
+ parent::_construct();
30
+ $this->setTemplate('paymill/payment/info/directdebit.phtml');
31
+ }
32
+
33
+ /**
34
+ * Add custom information to payment method information
35
+ *
36
+ * @param Varien_Object|array $transport
37
+ */
38
+ protected function _prepareSpecificInformation($transport = null)
39
+ {
40
+ if (null !== $this->_paymentSpecificInformation) {
41
+ return $this->_paymentSpecificInformation;
42
+ }
43
+ $transport = parent::_prepareSpecificInformation($transport);
44
+
45
+ $data = array();
46
+ $data['paymillTransactionId'] = $this->getInfo()->getAdditionalInformation('paymillTransactionId');
47
+ $data['imgUrl'] = Mage::helper('paymill')->getImagePath() . "icon_paymill.png";
48
+
49
+ return $transport->setData(array_merge($data, $transport->getData()));
50
+ }
51
+
52
+ }
app/code/community/Paymill/Paymill/Helper/CustomerHelper.php CHANGED
@@ -1,66 +1,66 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The Customer Helper contains methods dealing customer information.
24
- */
25
- class Paymill_Paymill_Helper_CustomerHelper extends Mage_Core_Helper_Abstract
26
- {
27
-
28
- /**
29
- * Returns the current customers full name
30
- * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
31
- * @return string the customers full name
32
- */
33
- public function getCustomerName($object)
34
- {
35
- $custFirstName = $object->getBillingAddress()->getFirstname();
36
- $custLastName = $object->getBillingAddress()->getLastname();
37
- $custFullName = $custFirstName . " " . $custLastName;
38
- return $custFullName;
39
- }
40
-
41
- /**
42
- * Returns the current customers email adress.
43
- * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
44
- * @return string the customers email adress
45
- */
46
- public function getCustomerEmail($object)
47
- {
48
- return $object->getCustomerEmail();
49
- }
50
-
51
- /**
52
- * Returns the Id of the user currently logged in.
53
- * Returns null if there is no logged in user.
54
- * @return String userId
55
- */
56
- public function getUserId()
57
- {
58
- $result = null;
59
- if (Mage::getSingleton('customer/session')->isLoggedIn()) {
60
- $result = Mage::getSingleton('customer/session')->getId();
61
- }
62
-
63
- return $result;
64
- }
65
-
66
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The Customer Helper contains methods dealing customer information.
24
+ */
25
+ class Paymill_Paymill_Helper_CustomerHelper extends Mage_Core_Helper_Abstract
26
+ {
27
+
28
+ /**
29
+ * Returns the current customers full name
30
+ * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
31
+ * @return string the customers full name
32
+ */
33
+ public function getCustomerName($object)
34
+ {
35
+ $custFirstName = $object->getBillingAddress()->getFirstname();
36
+ $custLastName = $object->getBillingAddress()->getLastname();
37
+ $custFullName = $custFirstName . " " . $custLastName;
38
+ return $custFullName;
39
+ }
40
+
41
+ /**
42
+ * Returns the current customers email adress.
43
+ * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
44
+ * @return string the customers email adress
45
+ */
46
+ public function getCustomerEmail($object)
47
+ {
48
+ return $object->getCustomerEmail();
49
+ }
50
+
51
+ /**
52
+ * Returns the Id of the user currently logged in.
53
+ * Returns null if there is no logged in user.
54
+ * @return String userId
55
+ */
56
+ public function getUserId()
57
+ {
58
+ $result = null;
59
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
60
+ $result = Mage::getSingleton('customer/session')->getId();
61
+ }
62
+
63
+ return $result;
64
+ }
65
+
66
  }
app/code/community/Paymill/Paymill/Helper/Data.php CHANGED
@@ -1,119 +1,119 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The Data Helper contains methods dealing with shopiformation.
24
- * Examples for this might be f.Ex backend option states or pathes.
25
- */
26
- class Paymill_Paymill_Helper_Data extends Mage_Core_Helper_Abstract
27
- {
28
-
29
- /**
30
- * Returns the path to the image directory as a string
31
- * @return string Path
32
- */
33
- public function getImagePath()
34
- {
35
- return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'skin/frontend/base/default/images/paymill/';
36
- }
37
-
38
- /**
39
- * Returns the path to the js directory as a string
40
- * @return string Path
41
- */
42
- public function getJscriptPath()
43
- {
44
- return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/paymill/';
45
- }
46
-
47
- /**
48
- * Returns the API Url
49
- * @return string
50
- */
51
- public function getApiUrl()
52
- {
53
- return "https://api.paymill.com/v2/";
54
- }
55
-
56
- /**
57
- * Returns the version of the plugin as a string
58
- * @return String Version
59
- */
60
- public function getVersion()
61
- {
62
- return (string) Mage::getConfig()->getNode()->modules->Paymill_Paymill->version;
63
- }
64
-
65
- /**
66
- * Returns a boolean deciding if the template is going to be displayed of not
67
- * @param String $code payment code
68
- * @return boolean
69
- */
70
- public function showTemplateForm($code)
71
- {
72
- $optionHelper = Mage::helper('paymill/optionHelper');
73
- $fcHelper = Mage::helper('paymill/fastCheckoutHelper');
74
-
75
- return !($optionHelper->isFastCheckoutEnabled() && $fcHelper->hasData($code));
76
- }
77
-
78
- /**
79
- * Returns the div tag opening defining the visibility of the payment form
80
- * @param String $code
81
- * @return string
82
- */
83
- public function getFormTypeForDisplay($code)
84
- {
85
- if ($this->showTemplateForm($code)) {
86
- return "<div>";
87
- } else {
88
- return "<div style='display:none;'>";
89
- }
90
- }
91
-
92
- /**
93
- * Returns the Source string passt to every transaction
94
- * @return String Source
95
- */
96
- public function getSourceString()
97
- {
98
- return $this->getVersion() . "_Magento_" . Mage::getVersion();
99
- }
100
-
101
- /**
102
- * Validates the private key value by comparing it to an empty string
103
- * @return boolean
104
- */
105
- public function isPrivateKeySet()
106
- {
107
- return Mage::helper('paymill/OptionHelper')->getPrivateKey() !== "";
108
- }
109
-
110
- /**
111
- * Validates the public key value by comparing it to an empty string
112
- * @return boolean
113
- */
114
- public function isPublicKeySet()
115
- {
116
- return Mage::helper('paymill/OptionHelper')->getPublicKey() !== "";
117
- }
118
-
119
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The Data Helper contains methods dealing with shopiformation.
24
+ * Examples for this might be f.Ex backend option states or pathes.
25
+ */
26
+ class Paymill_Paymill_Helper_Data extends Mage_Core_Helper_Abstract
27
+ {
28
+
29
+ /**
30
+ * Returns the path to the image directory as a string
31
+ * @return string Path
32
+ */
33
+ public function getImagePath()
34
+ {
35
+ return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'skin/frontend/base/default/images/paymill/';
36
+ }
37
+
38
+ /**
39
+ * Returns the path to the js directory as a string
40
+ * @return string Path
41
+ */
42
+ public function getJscriptPath()
43
+ {
44
+ return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/paymill/';
45
+ }
46
+
47
+ /**
48
+ * Returns the API Url
49
+ * @return string
50
+ */
51
+ public function getApiUrl()
52
+ {
53
+ return "https://api.paymill.com/v2/";
54
+ }
55
+
56
+ /**
57
+ * Returns the version of the plugin as a string
58
+ * @return String Version
59
+ */
60
+ public function getVersion()
61
+ {
62
+ return (string) Mage::getConfig()->getNode()->modules->Paymill_Paymill->version;
63
+ }
64
+
65
+ /**
66
+ * Returns a boolean deciding if the template is going to be displayed of not
67
+ * @param String $code payment code
68
+ * @return boolean
69
+ */
70
+ public function showTemplateForm($code)
71
+ {
72
+ $optionHelper = Mage::helper('paymill/optionHelper');
73
+ $fcHelper = Mage::helper('paymill/fastCheckoutHelper');
74
+
75
+ return !($optionHelper->isFastCheckoutEnabled() && $fcHelper->hasData($code));
76
+ }
77
+
78
+ /**
79
+ * Returns the div tag opening defining the visibility of the payment form
80
+ * @param String $code
81
+ * @return string
82
+ */
83
+ public function getFormTypeForDisplay($code)
84
+ {
85
+ if ($this->showTemplateForm($code)) {
86
+ return "<div>";
87
+ } else {
88
+ return "<div style='display:none;'>";
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Returns the Source string passt to every transaction
94
+ * @return String Source
95
+ */
96
+ public function getSourceString()
97
+ {
98
+ return $this->getVersion() . "_Magento_" . Mage::getVersion();
99
+ }
100
+
101
+ /**
102
+ * Validates the private key value by comparing it to an empty string
103
+ * @return boolean
104
+ */
105
+ public function isPrivateKeySet()
106
+ {
107
+ return Mage::helper('paymill/OptionHelper')->getPrivateKey() !== "";
108
+ }
109
+
110
+ /**
111
+ * Validates the public key value by comparing it to an empty string
112
+ * @return boolean
113
+ */
114
+ public function isPublicKeySet()
115
+ {
116
+ return Mage::helper('paymill/OptionHelper')->getPublicKey() !== "";
117
+ }
118
+
119
+ }
app/code/community/Paymill/Paymill/Helper/FastCheckoutHelper.php CHANGED
@@ -1,91 +1,91 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The FastCheckout Helper contains methods dealing with the fast checkout process.
24
- * Examples for this might be f.Ex a customers userId used for matching client data or methods to grant easier access the db information.
25
- */
26
- class Paymill_Paymill_Helper_FastCheckoutHelper extends Mage_Core_Helper_Abstract
27
- {
28
-
29
- /**
30
- * Calls the Data helper to get the state of the Fast Checkout option
31
- */
32
- public function isFastCheckoutEnabled()
33
- {
34
- return Mage::helper("paymill/optionHelper")->isFastCheckoutEnabled();
35
- }
36
-
37
- /**
38
- * Returns the clientId matched with the userId passed as an argument.
39
- * If no match is found, the return value will be null.
40
- * @param String $userId Unique identifier of the customer
41
- * @return String clientId matched with the userId <b>can be null if no match is found</b>
42
- */
43
- public function getClientId()
44
- {
45
- $userId = Mage::helper("paymill/customerHelper")->getUserId();
46
- $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
47
- $collection->addFilter('user_id', $userId);
48
- $obj = $collection->getFirstItem();
49
- return $obj->getClientId();
50
- }
51
-
52
- /**
53
- * Returns the PaymentId associated with the current user
54
- * @param String $code PaymentMethodCode
55
- * @return String paymentId
56
- */
57
- public function getPaymentId($code)
58
- {
59
- $userId = Mage::helper("paymill/customerHelper")->getUserId();
60
- return Mage::getModel("paymill/fastcheckout")->getPaymentId($userId, $code);
61
- }
62
-
63
- /**
64
- * Returns a boolean describing whether there is saved fc data for the current user
65
- * @param String $code PaymentMethodCode
66
- * @return boolean
67
- */
68
- public function hasData($code)
69
- {
70
- $userId = Mage::helper("paymill/customerHelper")->getUserId();
71
- if (Mage::getModel("paymill/fastcheckout")->hasFcData($userId, $code)) {
72
- return true;
73
- }
74
- return false;
75
- }
76
-
77
- /**
78
- * Saves the dataset into the database
79
- * @param String $code paymentCode
80
- * @param String $clientId Description
81
- * @param String $name Description
82
- */
83
- public function saveData($code, $clientId, $paymentId)
84
- {
85
- $userId = Mage::helper("paymill/customerHelper")->getUserId();
86
- if (isset($userId)) {
87
- Mage::getModel("paymill/fastcheckout")->saveFcData($code, $userId, $clientId, $paymentId);
88
- }
89
- }
90
-
91
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The FastCheckout Helper contains methods dealing with the fast checkout process.
24
+ * Examples for this might be f.Ex a customers userId used for matching client data or methods to grant easier access the db information.
25
+ */
26
+ class Paymill_Paymill_Helper_FastCheckoutHelper extends Mage_Core_Helper_Abstract
27
+ {
28
+
29
+ /**
30
+ * Calls the Data helper to get the state of the Fast Checkout option
31
+ */
32
+ public function isFastCheckoutEnabled()
33
+ {
34
+ return Mage::helper("paymill/optionHelper")->isFastCheckoutEnabled();
35
+ }
36
+
37
+ /**
38
+ * Returns the clientId matched with the userId passed as an argument.
39
+ * If no match is found, the return value will be null.
40
+ * @param String $userId Unique identifier of the customer
41
+ * @return String clientId matched with the userId <b>can be null if no match is found</b>
42
+ */
43
+ public function getClientId()
44
+ {
45
+ $userId = Mage::helper("paymill/customerHelper")->getUserId();
46
+ $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
47
+ $collection->addFilter('user_id', $userId);
48
+ $obj = $collection->getFirstItem();
49
+ return $obj->getClientId();
50
+ }
51
+
52
+ /**
53
+ * Returns the PaymentId associated with the current user
54
+ * @param String $code PaymentMethodCode
55
+ * @return String paymentId
56
+ */
57
+ public function getPaymentId($code)
58
+ {
59
+ $userId = Mage::helper("paymill/customerHelper")->getUserId();
60
+ return Mage::getModel("paymill/fastcheckout")->getPaymentId($userId, $code);
61
+ }
62
+
63
+ /**
64
+ * Returns a boolean describing whether there is saved fc data for the current user
65
+ * @param String $code PaymentMethodCode
66
+ * @return boolean
67
+ */
68
+ public function hasData($code)
69
+ {
70
+ $userId = Mage::helper("paymill/customerHelper")->getUserId();
71
+ if (Mage::getModel("paymill/fastcheckout")->hasFcData($userId, $code)) {
72
+ return true;
73
+ }
74
+ return false;
75
+ }
76
+
77
+ /**
78
+ * Saves the dataset into the database
79
+ * @param String $code paymentCode
80
+ * @param String $clientId Description
81
+ * @param String $name Description
82
+ */
83
+ public function saveData($code, $clientId, $paymentId)
84
+ {
85
+ $userId = Mage::helper("paymill/customerHelper")->getUserId();
86
+ if (isset($userId)) {
87
+ Mage::getModel("paymill/fastcheckout")->saveFcData($code, $userId, $clientId, $paymentId);
88
+ }
89
+ }
90
+
91
  }
app/code/community/Paymill/Paymill/Helper/LoggingHelper.php CHANGED
@@ -1,50 +1,50 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The Logging Helper contains methods dealing with Log entries.
24
- * Examples for this might be f.Ex logging data or reading from the log.
25
- */
26
- class Paymill_Paymill_Helper_LoggingHelper extends Mage_Core_Helper_Abstract implements Services_Paymill_LoggingInterface
27
- {
28
-
29
- /**
30
- * Inserts the arguments into the db log
31
- * @param String $merchantInfo
32
- * @param String $devInfo
33
- * @param String $devInfoAdditional
34
- */
35
- public function log($merchantInfo, $devInfo = null, $devInfoAdditional = null)
36
- {
37
- Mage::getModel('paymill/log')->log($merchantInfo, $devInfo, $devInfoAdditional);
38
- }
39
-
40
- /**
41
- * Returns a collection of all log-entries
42
- * @return Collection Description
43
- */
44
- public function getEntries()
45
- {
46
- $collection = Mage::getModel('paymill/log')->getCollection();
47
- return $collection;
48
- }
49
-
50
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The Logging Helper contains methods dealing with Log entries.
24
+ * Examples for this might be f.Ex logging data or reading from the log.
25
+ */
26
+ class Paymill_Paymill_Helper_LoggingHelper extends Mage_Core_Helper_Abstract implements Services_Paymill_LoggingInterface
27
+ {
28
+
29
+ /**
30
+ * Inserts the arguments into the db log
31
+ * @param String $merchantInfo
32
+ * @param String $devInfo
33
+ * @param String $devInfoAdditional
34
+ */
35
+ public function log($merchantInfo, $devInfo = null, $devInfoAdditional = null)
36
+ {
37
+ Mage::getModel('paymill/log')->log($merchantInfo, $devInfo, $devInfoAdditional);
38
+ }
39
+
40
+ /**
41
+ * Returns a collection of all log-entries
42
+ * @return Collection Description
43
+ */
44
+ public function getEntries()
45
+ {
46
+ $collection = Mage::getModel('paymill/log')->getCollection();
47
+ return $collection;
48
+ }
49
+
50
  }
app/code/community/Paymill/Paymill/Helper/OptionHelper.php CHANGED
@@ -1,135 +1,135 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The Option Helper contains methods dealing with reading out backend options.
24
- */
25
- class Paymill_Paymill_Helper_OptionHelper extends Mage_Core_Helper_Abstract
26
- {
27
-
28
- /**
29
- * Returns the Public Key from the Backend as a string
30
- * @return String
31
- */
32
- public function getPublicKey()
33
- {
34
- return trim($this->_getGeneralOption("public_key"));
35
- }
36
-
37
- /**
38
- * Returns the Private Key from the Backend as a string
39
- * @return String
40
- */
41
- public function getPrivateKey()
42
- {
43
- return trim($this->_getGeneralOption("private_key"));
44
- }
45
-
46
- /**
47
- * Returns the state of the "Logging" Switch from the Backend as a Boolean
48
- * @return Boolean
49
- */
50
- public function isLogging()
51
- {
52
- return $this->_getGeneralOption("logging_active");
53
- }
54
-
55
- /**
56
- * Returns the state of the "FastCheckout" Switch from the Backend as a Boolean
57
- * @return Boolean
58
- */
59
- public function isFastCheckoutEnabled()
60
- {
61
- return $this->_getGeneralOption("fc_active");
62
- }
63
-
64
- /**
65
- * Returns the state of the "Debug" Switch from the Backend as a Boolean
66
- * @return Boolean
67
- */
68
- public function isInDebugMode()
69
- {
70
- return $this->_getGeneralOption("debugging_active");
71
- }
72
-
73
- /**
74
- * Returns the state of the "Show Labels" Switch from the Backend as a Boolean
75
- * @return Boolean
76
- */
77
- public function isShowingLabels()
78
- {
79
- return $this->_getGeneralOption("show_label");
80
- }
81
-
82
- /**
83
- * Returns the value of the given backend option.
84
- * <p align = "center">Needs the $_storeId to be set to work properly</p>
85
- * @param String $choice Name of the desired category as a string
86
- * @param String $optionName Name of the desired option as a string
87
- * @return mixed Value of the Backend Option
88
- * @throws Exception "No Store Id has been set."
89
- */
90
- private function _getBackendOption($choice, $optionName)
91
- {
92
- try {
93
- $value = Mage::getStoreConfig('payment/' . $choice . '/' . $optionName, Mage::app()->getStore()->getStoreId());
94
- } catch (Exception $ex) {
95
- $value = "An Error has occoured getting the config element";
96
- }
97
-
98
- return $value;
99
- }
100
-
101
- /**
102
- * Returns the Value of the general Option with the given name.
103
- * <p align = "center">Needs the $_storeId to be set to work properly</p>
104
- * @param String $optionName
105
- * @return mixed Value
106
- */
107
- private function _getGeneralOption($optionName)
108
- {
109
- return $this->_getBackendOption("paymill", $optionName);
110
- }
111
-
112
- /**
113
- * Returns the state of the "preAuth" Switch from the Backend as a Boolean
114
- * @return boolean
115
- */
116
- public function isPreAuthorizing()
117
- {
118
- return $this->_getGeneralOption("preAuth_active");
119
- }
120
-
121
- /**
122
- * Returns the Token Tolerance Value for the given payment
123
- * @param String $paymentType Paymentcode
124
- * @return int Token Tolerance Value (in multiplied format eg 10.00 to 1000)
125
- */
126
- public function getTokenTolerance($paymentType)
127
- {
128
- $optionValue = $this->_getBackendOption($paymentType, 'tokenTolerance');
129
- $formattedValue = str_replace(',', '.', $optionValue);
130
- $value = (string) (number_format((float) $formattedValue, 2) * 100);
131
-
132
- return $value;
133
- }
134
-
135
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The Option Helper contains methods dealing with reading out backend options.
24
+ */
25
+ class Paymill_Paymill_Helper_OptionHelper extends Mage_Core_Helper_Abstract
26
+ {
27
+
28
+ /**
29
+ * Returns the Public Key from the Backend as a string
30
+ * @return String
31
+ */
32
+ public function getPublicKey()
33
+ {
34
+ return trim($this->_getGeneralOption("public_key"));
35
+ }
36
+
37
+ /**
38
+ * Returns the Private Key from the Backend as a string
39
+ * @return String
40
+ */
41
+ public function getPrivateKey()
42
+ {
43
+ return trim($this->_getGeneralOption("private_key"));
44
+ }
45
+
46
+ /**
47
+ * Returns the state of the "Logging" Switch from the Backend as a Boolean
48
+ * @return Boolean
49
+ */
50
+ public function isLogging()
51
+ {
52
+ return $this->_getGeneralOption("logging_active");
53
+ }
54
+
55
+ /**
56
+ * Returns the state of the "FastCheckout" Switch from the Backend as a Boolean
57
+ * @return Boolean
58
+ */
59
+ public function isFastCheckoutEnabled()
60
+ {
61
+ return $this->_getGeneralOption("fc_active");
62
+ }
63
+
64
+ /**
65
+ * Returns the state of the "Debug" Switch from the Backend as a Boolean
66
+ * @return Boolean
67
+ */
68
+ public function isInDebugMode()
69
+ {
70
+ return $this->_getGeneralOption("debugging_active");
71
+ }
72
+
73
+ /**
74
+ * Returns the state of the "Show Labels" Switch from the Backend as a Boolean
75
+ * @return Boolean
76
+ */
77
+ public function isShowingLabels()
78
+ {
79
+ return $this->_getGeneralOption("show_label");
80
+ }
81
+
82
+ /**
83
+ * Returns the value of the given backend option.
84
+ * <p align = "center">Needs the $_storeId to be set to work properly</p>
85
+ * @param String $choice Name of the desired category as a string
86
+ * @param String $optionName Name of the desired option as a string
87
+ * @return mixed Value of the Backend Option
88
+ * @throws Exception "No Store Id has been set."
89
+ */
90
+ private function _getBackendOption($choice, $optionName)
91
+ {
92
+ try {
93
+ $value = Mage::getStoreConfig('payment/' . $choice . '/' . $optionName, Mage::app()->getStore()->getStoreId());
94
+ } catch (Exception $ex) {
95
+ $value = "An Error has occoured getting the config element";
96
+ }
97
+
98
+ return $value;
99
+ }
100
+
101
+ /**
102
+ * Returns the Value of the general Option with the given name.
103
+ * <p align = "center">Needs the $_storeId to be set to work properly</p>
104
+ * @param String $optionName
105
+ * @return mixed Value
106
+ */
107
+ private function _getGeneralOption($optionName)
108
+ {
109
+ return $this->_getBackendOption("paymill", $optionName);
110
+ }
111
+
112
+ /**
113
+ * Returns the state of the "preAuth" Switch from the Backend as a Boolean
114
+ * @return boolean
115
+ */
116
+ public function isPreAuthorizing()
117
+ {
118
+ return $this->_getGeneralOption("preAuth_active");
119
+ }
120
+
121
+ /**
122
+ * Returns the Token Tolerance Value for the given payment
123
+ * @param String $paymentType Paymentcode
124
+ * @return int Token Tolerance Value (in multiplied format eg 10.00 to 1000)
125
+ */
126
+ public function getTokenTolerance($paymentType)
127
+ {
128
+ $optionValue = $this->_getBackendOption($paymentType, 'tokenTolerance');
129
+ $formattedValue = str_replace(',', '.', $optionValue);
130
+ $value = (string) (number_format((float) $formattedValue, 2) * 100);
131
+
132
+ return $value;
133
+ }
134
+
135
+ }
app/code/community/Paymill/Paymill/Helper/PaymentHelper.php CHANGED
@@ -1,281 +1,281 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The Payment Helper contains methods dealing with payment relevant information.
24
- * Examples for this might be f.Ex customer data, formating of basket amounts or similar.
25
- */
26
- class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
27
- {
28
-
29
- /**
30
- * Returns the order amount in the smallest possible unit (f.Ex. cent for the EUR currency)
31
- * <p align = "center" color = "red">At the moment, only currencies with a 1:100 conversion are supported. Special cases need to be added if necessary</p>
32
- * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
33
- * @return int Amount in the smallest possible unit
34
- */
35
- public function getAmount($object = null)
36
- {
37
- if ($object == null) {
38
- $object = Mage::getSingleton('checkout/session')->getQuote();
39
- }
40
- $decimalTotal = $object->getGrandTotal();
41
- $amountTotal = $decimalTotal * 100;
42
- return $amountTotal;
43
- }
44
-
45
- /**
46
- * Returns the PreAuthAmount and sets a session var for later use
47
- * @param String $_code
48
- */
49
- public function getPreAuthAmount($_code)
50
- {
51
- $amount = $this->getAmount() + Mage::helper('paymill/optionHelper')->getTokenTolerance($_code);
52
- Mage::getSingleton('core/session')->setPreAuthAmount($amount);
53
- return $amount;
54
- }
55
-
56
- /**
57
- * Returns the currency compliant to ISO 4217 (3 char code)
58
- * @return string 3 Character long currency code
59
- */
60
- public function getCurrency()
61
- {
62
- $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
63
- return $currency_code;
64
- }
65
-
66
- /**
67
- * Returns the description you want to display in the Paymill Backend.
68
- * The current format is [OrderId] [Email adress of the customer]
69
- * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
70
- * @return string
71
- */
72
- public function getDescription($object)
73
- {
74
- $orderId = $this->getOrderId($object);
75
- $customerEmail = Mage::helper("paymill/customerHelper")->getCustomerEmail($object);
76
- $description = $orderId . ", " . $customerEmail;
77
-
78
- return $description;
79
- }
80
-
81
- /**
82
- * Returns the short tag of the Payment
83
- * @param String $code
84
- * @return string
85
- */
86
- public function getPaymentType($code)
87
- {
88
- //Creditcard
89
- if ($code === "paymill_creditcard") {
90
- $type = "cc";
91
- }
92
- //Directdebit
93
- if ($code === "paymill_directdebit") {
94
- $type = "elv";
95
- }
96
-
97
- return $type;
98
- }
99
-
100
- /**
101
- * Returns the reserved order id
102
- * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
103
- * @return String OrderId
104
- */
105
- public function getOrderId($object)
106
- {
107
- $orderId = null;
108
-
109
- if ($object instanceof Mage_Sales_Model_Order) {
110
- $orderId = $object->getIncrementId();
111
- }
112
-
113
- if ($object instanceof Mage_Sales_Model_Quote) {
114
- $orderId = $object->getReservedOrderId();
115
- }
116
-
117
-
118
- return $orderId;
119
- }
120
-
121
- /**
122
- * Returns an instance of the paymentProcessor class.
123
- * @param String $paymentCode name of the payment
124
- * @param String $token Token generated by the Javascript
125
- * @param Integer $authorizedAmount Amount used for the Token generation
126
- * @return Services_Paymill_PaymentProcessor
127
- */
128
- public function createPaymentProcessor($paymentCode, $token)
129
- {
130
- $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
131
- $apiUrl = Mage::helper('paymill')->getApiUrl();
132
- $quote = Mage::getSingleton('checkout/session')->getQuote();
133
- $libBase = null;
134
-
135
- $params = array();
136
- $params['token'] = $token;
137
- $params['amount'] = (int) $this->getAmount();
138
- $params['currency'] = $this->getCurrency();
139
- $params['payment'] = $this->getPaymentType($paymentCode); // The chosen payment (cc | elv)
140
- $params['name'] = Mage::helper("paymill/customerHelper")->getCustomerName($quote);
141
- $params['email'] = Mage::helper("paymill/customerHelper")->getCustomerEmail($quote);
142
- $params['description'] = $this->getDescription($quote);
143
- $params['source'] = Mage::helper('paymill')->getSourceString();
144
-
145
- $paymentProcessor = new Services_Paymill_PaymentProcessor($privateKey, $apiUrl, $libBase, $params, Mage::helper('paymill/loggingHelper'));
146
- return $paymentProcessor;
147
- }
148
-
149
- /**
150
- * Creates a client object from the given data and returns the Id
151
- * @param String $email
152
- * @param String $description
153
- * @return String ClientId
154
- * @throws Exception "Invalid Result Exception: Invalid ResponseCode for Client"
155
- */
156
- public function createClient($email, $description)
157
- {
158
- $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
159
- $apiUrl = Mage::helper('paymill')->getApiUrl();
160
-
161
- if (empty($privateKey)) {
162
- Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
163
- Mage::throwException("No private Key was set.");
164
- }
165
-
166
- $clientsObject = new Services_Paymill_Clients($privateKey, $apiUrl);
167
-
168
- $client = $clientsObject->create(
169
- array(
170
- 'email' => $email,
171
- 'description' => $description
172
- )
173
- );
174
-
175
- if (isset($client['data']['response_code']) && $client['data']['response_code'] !== 20000) {
176
- $this->_log("An Error occured: " . $client['data']['response_code'], var_export($client, true));
177
- throw new Exception("Invalid Result Exception: Invalid ResponseCode for Client");
178
- }
179
-
180
- $clientId = $client['id'];
181
- Mage::helper('paymill/loggingHelper')->log("Client created.", $clientId);
182
- return $clientId;
183
- }
184
-
185
- /**
186
- * Creates a payment object from the given data and returns the Id
187
- * @param String $token
188
- * @param String $clientId
189
- * @return String PaymentId
190
- * @throws Exception "Invalid Result Exception: Invalid ResponseCode for Payment"
191
- */
192
- public function createPayment($token, $clientId)
193
- {
194
- $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
195
- $apiUrl = Mage::helper('paymill')->getApiUrl();
196
-
197
- if (empty($privateKey)) {
198
- Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
199
- Mage::throwException("No private Key was set.");
200
- }
201
-
202
- $paymentsObject = new Services_Paymill_Payments($privateKey, $apiUrl);
203
-
204
- $payment = $paymentsObject->create(
205
- array(
206
- 'token' => $token,
207
- 'client' => $clientId
208
- )
209
- );
210
-
211
- if (isset($payment['data']['response_code']) && $payment['data']['response_code'] !== 20000) {
212
- $this->_log("An Error occured: " . $payment['data']['response_code'], var_export($payment, true));
213
- throw new Exception("Invalid Result Exception: Invalid ResponseCode for Payment");
214
- }
215
-
216
- $paymentId = $payment['id'];
217
- Mage::helper('paymill/loggingHelper')->log("Payment created.", $paymentId);
218
- return $paymentId;
219
- }
220
-
221
- /**
222
- * Creates a preAuthorization with the given arguments
223
- * @param String $token
224
- * @param String $paymentId if given, this replaces the token to use fast checkout
225
- * @return mixed Response
226
- */
227
- public function createPreAuthorization($paymentId)
228
- {
229
- $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
230
- $apiUrl = Mage::helper('paymill')->getApiUrl();
231
-
232
- if (empty($privateKey)) {
233
- Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
234
- Mage::throwException("No private Key was set.");
235
- }
236
-
237
- $preAuthObject = new Services_Paymill_Preauthorizations($privateKey, $apiUrl);
238
-
239
- $amount = (int) $this->getAmount();
240
- $currency = $this->getCurrency();
241
-
242
- $params = array('payment' => $paymentId, 'source' => Mage::helper('paymill')->getSourceString(), 'amount' => $amount, 'currency' => $currency);
243
- $preAuth = $preAuthObject->create($params);
244
-
245
- Mage::helper('paymill/loggingHelper')->log("PreAuthorization created from Payment", $preAuth['preauthorization']['id'], print_r($params, true));
246
-
247
- return $preAuth['preauthorization'];
248
- }
249
-
250
- /**
251
- * Generates a transaction from the given arguments
252
- * @param Mage_Sales_Model_Order $order
253
- * @param String $preAuthorizationId
254
- * @param float|double $amount
255
- * @return Boolean Indicator of success
256
- */
257
- public function createTransactionFromPreAuth($order, $preAuthorizationId, $amount)
258
- {
259
- $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
260
- $apiUrl = Mage::helper('paymill')->getApiUrl();
261
- if (empty($privateKey)) {
262
- Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
263
- Mage::throwException("No private Key was set.");
264
- }
265
-
266
- $transactionsObject = new Services_Paymill_Transactions($privateKey, $apiUrl);
267
- $params = array(
268
- 'amount' => (int) ($amount * 100),
269
- 'currency' => $this->getCurrency(),
270
- 'description' => $this->getDescription($order),
271
- 'source' => Mage::helper('paymill')->getSourceString(),
272
- 'preauthorization' => $preAuthorizationId
273
- );
274
-
275
- $transaction = $transactionsObject->create($params);
276
- Mage::helper('paymill/loggingHelper')->log("Creating Transaction from PreAuthorization", print_r($params, true), var_export($transaction, true));
277
-
278
- return $transaction;
279
- }
280
-
281
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The Payment Helper contains methods dealing with payment relevant information.
24
+ * Examples for this might be f.Ex customer data, formating of basket amounts or similar.
25
+ */
26
+ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
27
+ {
28
+
29
+ /**
30
+ * Returns the order amount in the smallest possible unit (f.Ex. cent for the EUR currency)
31
+ * <p align = "center" color = "red">At the moment, only currencies with a 1:100 conversion are supported. Special cases need to be added if necessary</p>
32
+ * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
33
+ * @return int Amount in the smallest possible unit
34
+ */
35
+ public function getAmount($object = null)
36
+ {
37
+ if ($object == null) {
38
+ $object = Mage::getSingleton('checkout/session')->getQuote();
39
+ }
40
+ $decimalTotal = $object->getGrandTotal();
41
+ $amountTotal = $decimalTotal * 100;
42
+ return $amountTotal;
43
+ }
44
+
45
+ /**
46
+ * Returns the PreAuthAmount and sets a session var for later use
47
+ * @param String $_code
48
+ */
49
+ public function getPreAuthAmount($_code)
50
+ {
51
+ $amount = $this->getAmount() + Mage::helper('paymill/optionHelper')->getTokenTolerance($_code);
52
+ Mage::getSingleton('core/session')->setPreAuthAmount($amount);
53
+ return $amount;
54
+ }
55
+
56
+ /**
57
+ * Returns the currency compliant to ISO 4217 (3 char code)
58
+ * @return string 3 Character long currency code
59
+ */
60
+ public function getCurrency()
61
+ {
62
+ $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
63
+ return $currency_code;
64
+ }
65
+
66
+ /**
67
+ * Returns the description you want to display in the Paymill Backend.
68
+ * The current format is [OrderId] [Email adress of the customer]
69
+ * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
70
+ * @return string
71
+ */
72
+ public function getDescription($object)
73
+ {
74
+ $orderId = $this->getOrderId($object);
75
+ $customerEmail = Mage::helper("paymill/customerHelper")->getCustomerEmail($object);
76
+ $description = $orderId . ", " . $customerEmail;
77
+
78
+ return $description;
79
+ }
80
+
81
+ /**
82
+ * Returns the short tag of the Payment
83
+ * @param String $code
84
+ * @return string
85
+ */
86
+ public function getPaymentType($code)
87
+ {
88
+ //Creditcard
89
+ if ($code === "paymill_creditcard") {
90
+ $type = "cc";
91
+ }
92
+ //Directdebit
93
+ if ($code === "paymill_directdebit") {
94
+ $type = "elv";
95
+ }
96
+
97
+ return $type;
98
+ }
99
+
100
+ /**
101
+ * Returns the reserved order id
102
+ * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
103
+ * @return String OrderId
104
+ */
105
+ public function getOrderId($object)
106
+ {
107
+ $orderId = null;
108
+
109
+ if ($object instanceof Mage_Sales_Model_Order) {
110
+ $orderId = $object->getIncrementId();
111
+ }
112
+
113
+ if ($object instanceof Mage_Sales_Model_Quote) {
114
+ $orderId = $object->getReservedOrderId();
115
+ }
116
+
117
+
118
+ return $orderId;
119
+ }
120
+
121
+ /**
122
+ * Returns an instance of the paymentProcessor class.
123
+ * @param String $paymentCode name of the payment
124
+ * @param String $token Token generated by the Javascript
125
+ * @param Integer $authorizedAmount Amount used for the Token generation
126
+ * @return Services_Paymill_PaymentProcessor
127
+ */
128
+ public function createPaymentProcessor($paymentCode, $token)
129
+ {
130
+ $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
131
+ $apiUrl = Mage::helper('paymill')->getApiUrl();
132
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
133
+ $libBase = null;
134
+
135
+ $params = array();
136
+ $params['token'] = $token;
137
+ $params['amount'] = (int) $this->getAmount();
138
+ $params['currency'] = $this->getCurrency();
139
+ $params['payment'] = $this->getPaymentType($paymentCode); // The chosen payment (cc | elv)
140
+ $params['name'] = Mage::helper("paymill/customerHelper")->getCustomerName($quote);
141
+ $params['email'] = Mage::helper("paymill/customerHelper")->getCustomerEmail($quote);
142
+ $params['description'] = $this->getDescription($quote);
143
+ $params['source'] = Mage::helper('paymill')->getSourceString();
144
+
145
+ $paymentProcessor = new Services_Paymill_PaymentProcessor($privateKey, $apiUrl, $libBase, $params, Mage::helper('paymill/loggingHelper'));
146
+ return $paymentProcessor;
147
+ }
148
+
149
+ /**
150
+ * Creates a client object from the given data and returns the Id
151
+ * @param String $email
152
+ * @param String $description
153
+ * @return String ClientId
154
+ * @throws Exception "Invalid Result Exception: Invalid ResponseCode for Client"
155
+ */
156
+ public function createClient($email, $description)
157
+ {
158
+ $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
159
+ $apiUrl = Mage::helper('paymill')->getApiUrl();
160
+
161
+ if (empty($privateKey)) {
162
+ Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
163
+ Mage::throwException("No private Key was set.");
164
+ }
165
+
166
+ $clientsObject = new Services_Paymill_Clients($privateKey, $apiUrl);
167
+
168
+ $client = $clientsObject->create(
169
+ array(
170
+ 'email' => $email,
171
+ 'description' => $description
172
+ )
173
+ );
174
+
175
+ if (isset($client['data']['response_code']) && $client['data']['response_code'] !== 20000) {
176
+ $this->_log("An Error occured: " . $client['data']['response_code'], var_export($client, true));
177
+ throw new Exception("Invalid Result Exception: Invalid ResponseCode for Client");
178
+ }
179
+
180
+ $clientId = $client['id'];
181
+ Mage::helper('paymill/loggingHelper')->log("Client created.", $clientId);
182
+ return $clientId;
183
+ }
184
+
185
+ /**
186
+ * Creates a payment object from the given data and returns the Id
187
+ * @param String $token
188
+ * @param String $clientId
189
+ * @return String PaymentId
190
+ * @throws Exception "Invalid Result Exception: Invalid ResponseCode for Payment"
191
+ */
192
+ public function createPayment($token, $clientId)
193
+ {
194
+ $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
195
+ $apiUrl = Mage::helper('paymill')->getApiUrl();
196
+
197
+ if (empty($privateKey)) {
198
+ Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
199
+ Mage::throwException("No private Key was set.");
200
+ }
201
+
202
+ $paymentsObject = new Services_Paymill_Payments($privateKey, $apiUrl);
203
+
204
+ $payment = $paymentsObject->create(
205
+ array(
206
+ 'token' => $token,
207
+ 'client' => $clientId
208
+ )
209
+ );
210
+
211
+ if (isset($payment['data']['response_code']) && $payment['data']['response_code'] !== 20000) {
212
+ $this->_log("An Error occured: " . $payment['data']['response_code'], var_export($payment, true));
213
+ throw new Exception("Invalid Result Exception: Invalid ResponseCode for Payment");
214
+ }
215
+
216
+ $paymentId = $payment['id'];
217
+ Mage::helper('paymill/loggingHelper')->log("Payment created.", $paymentId);
218
+ return $paymentId;
219
+ }
220
+
221
+ /**
222
+ * Creates a preAuthorization with the given arguments
223
+ * @param String $token
224
+ * @param String $paymentId if given, this replaces the token to use fast checkout
225
+ * @return mixed Response
226
+ */
227
+ public function createPreAuthorization($paymentId)
228
+ {
229
+ $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
230
+ $apiUrl = Mage::helper('paymill')->getApiUrl();
231
+
232
+ if (empty($privateKey)) {
233
+ Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
234
+ Mage::throwException("No private Key was set.");
235
+ }
236
+
237
+ $preAuthObject = new Services_Paymill_Preauthorizations($privateKey, $apiUrl);
238
+
239
+ $amount = (int) $this->getAmount();
240
+ $currency = $this->getCurrency();
241
+
242
+ $params = array('payment' => $paymentId, 'source' => Mage::helper('paymill')->getSourceString(), 'amount' => $amount, 'currency' => $currency);
243
+ $preAuth = $preAuthObject->create($params);
244
+
245
+ Mage::helper('paymill/loggingHelper')->log("PreAuthorization created from Payment", $preAuth['preauthorization']['id'], print_r($params, true));
246
+
247
+ return $preAuth['preauthorization'];
248
+ }
249
+
250
+ /**
251
+ * Generates a transaction from the given arguments
252
+ * @param Mage_Sales_Model_Order $order
253
+ * @param String $preAuthorizationId
254
+ * @param float|double $amount
255
+ * @return Boolean Indicator of success
256
+ */
257
+ public function createTransactionFromPreAuth($order, $preAuthorizationId, $amount)
258
+ {
259
+ $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
260
+ $apiUrl = Mage::helper('paymill')->getApiUrl();
261
+ if (empty($privateKey)) {
262
+ Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
263
+ Mage::throwException("No private Key was set.");
264
+ }
265
+
266
+ $transactionsObject = new Services_Paymill_Transactions($privateKey, $apiUrl);
267
+ $params = array(
268
+ 'amount' => (int) ($amount * 100),
269
+ 'currency' => $this->getCurrency(),
270
+ 'description' => $this->getDescription($order),
271
+ 'source' => Mage::helper('paymill')->getSourceString(),
272
+ 'preauthorization' => $preAuthorizationId
273
+ );
274
+
275
+ $transaction = $transactionsObject->create($params);
276
+ Mage::helper('paymill/loggingHelper')->log("Creating Transaction from PreAuthorization", print_r($params, true), var_export($transaction, true));
277
+
278
+ return $transaction;
279
+ }
280
+
281
+ }
app/code/community/Paymill/Paymill/Helper/RefundHelper.php CHANGED
@@ -1,86 +1,86 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The Refund Helper contains methods dealing with refund processes.
24
- */
25
- class Paymill_Paymill_Helper_RefundHelper extends Mage_Core_Helper_Abstract
26
- {
27
-
28
- /**
29
- * Validates the result of the refund
30
- * @param mixed $refund
31
- * @return boolean
32
- */
33
- private function validateRefund($refund)
34
- {
35
- //Logs errorfeedback in case of any other response than ok
36
- if (isset($refund['data']['response_code']) && $refund['data']['response_code'] !== 20000) {
37
- Mage::helper('paymill/loggingHelper')->log("An Error occured: " . $refund['data']['response_code'], var_export($refund, true));
38
- return false;
39
- }
40
-
41
- //Logs feedback in case of an unset id
42
- if (!isset($refund['id']) && !isset($refund['data']['id'])) {
43
- Mage::helper('paymill/loggingHelper')->log("No Refund created.", var_export($refund, true));
44
- return false;
45
- } else { //Logs success feedback for debugging purposes
46
- Mage::helper('paymill/loggingHelper')->log("Refund created.", $refund['id'], var_export($refund, true));
47
- }
48
-
49
- return true;
50
- }
51
-
52
- /**
53
- * Creates a refund from the ordernumber passed as an argument
54
- * @param Mage_Sales_Model_Order $order
55
- * @return boolean Indicator of success
56
- */
57
- public function createRefund($order, $amount)
58
- {
59
- //Gather Data
60
- try {
61
- $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
62
- $apiUrl = Mage::helper('paymill')->getApiUrl();
63
- $refundsObject = new Services_Paymill_Refunds($privateKey, $apiUrl);
64
- $transactionId = Mage::helper('paymill/transactionHelper')->getTransactionId($order);
65
- } catch (Exception $ex) {
66
- Mage::helper('paymill/loggingHelper')->log("No Refund created due to illegal parameters.", $ex->getMessage());
67
- return false;
68
- }
69
-
70
- //Create Refund
71
- $params = array(
72
- 'transactionId' => $transactionId,
73
- 'source' => Mage::helper('paymill')->getSourceString(),
74
- 'params' => array('amount' => $amount)
75
- );
76
- try {
77
- $refund = $refundsObject->create($params);
78
- } catch (Exception $ex) {
79
- Mage::helper('paymill/loggingHelper')->log("No Refund created.", $ex->getMessage(), var_export($params, true));
80
- return false;
81
- }
82
- //Validate Refund and return feedback
83
- return $this->validateRefund($refund);
84
- }
85
-
86
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The Refund Helper contains methods dealing with refund processes.
24
+ */
25
+ class Paymill_Paymill_Helper_RefundHelper extends Mage_Core_Helper_Abstract
26
+ {
27
+
28
+ /**
29
+ * Validates the result of the refund
30
+ * @param mixed $refund
31
+ * @return boolean
32
+ */
33
+ private function validateRefund($refund)
34
+ {
35
+ //Logs errorfeedback in case of any other response than ok
36
+ if (isset($refund['data']['response_code']) && $refund['data']['response_code'] !== 20000) {
37
+ Mage::helper('paymill/loggingHelper')->log("An Error occured: " . $refund['data']['response_code'], var_export($refund, true));
38
+ return false;
39
+ }
40
+
41
+ //Logs feedback in case of an unset id
42
+ if (!isset($refund['id']) && !isset($refund['data']['id'])) {
43
+ Mage::helper('paymill/loggingHelper')->log("No Refund created.", var_export($refund, true));
44
+ return false;
45
+ } else { //Logs success feedback for debugging purposes
46
+ Mage::helper('paymill/loggingHelper')->log("Refund created.", $refund['id'], var_export($refund, true));
47
+ }
48
+
49
+ return true;
50
+ }
51
+
52
+ /**
53
+ * Creates a refund from the ordernumber passed as an argument
54
+ * @param Mage_Sales_Model_Order $order
55
+ * @return boolean Indicator of success
56
+ */
57
+ public function createRefund($order, $amount)
58
+ {
59
+ //Gather Data
60
+ try {
61
+ $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
62
+ $apiUrl = Mage::helper('paymill')->getApiUrl();
63
+ $refundsObject = new Services_Paymill_Refunds($privateKey, $apiUrl);
64
+ $transactionId = Mage::helper('paymill/transactionHelper')->getTransactionId($order);
65
+ } catch (Exception $ex) {
66
+ Mage::helper('paymill/loggingHelper')->log("No Refund created due to illegal parameters.", $ex->getMessage());
67
+ return false;
68
+ }
69
+
70
+ //Create Refund
71
+ $params = array(
72
+ 'transactionId' => $transactionId,
73
+ 'source' => Mage::helper('paymill')->getSourceString(),
74
+ 'params' => array('amount' => $amount)
75
+ );
76
+ try {
77
+ $refund = $refundsObject->create($params);
78
+ } catch (Exception $ex) {
79
+ Mage::helper('paymill/loggingHelper')->log("No Refund created.", $ex->getMessage(), var_export($params, true));
80
+ return false;
81
+ }
82
+ //Validate Refund and return feedback
83
+ return $this->validateRefund($refund);
84
+ }
85
+
86
  }
app/code/community/Paymill/Paymill/Helper/TransactionHelper.php CHANGED
@@ -1,97 +1,97 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- /**
23
- * The Transaction Helper contains methods dealing saving and loading additional transaction data into and from order objects.
24
- */
25
- class Paymill_Paymill_Helper_TransactionHelper extends Mage_Core_Helper_Abstract
26
- {
27
-
28
- /**
29
- * Reads the additional data string from the argumented order object and returns it as an instance of Paymill_Paymill_Model_Transaction
30
- * @param Mage_Sales_Model_Order_Payment $object
31
- * @return Paymill_Paymill_Model_TransactionData Transaction Model
32
- */
33
- public function getAdditionalInformation(Mage_Sales_Model_Order_Payment $object)
34
- {
35
- $transactionId = $object->getAdditionalInformation('paymillTransactionId');
36
- $preAuthflag = $object->getAdditionalInformation('paymillPreAuthFlag');
37
- $model = $this->createTransactionModel($transactionId, $preAuthflag);
38
- return $model;
39
- }
40
-
41
- /**
42
- * Sets the additional Data string of the argumented object to the valueS of the argumented instance of the Paymill_Paymill_Model_Transaction
43
- * @param Mage_Sales_Model_Order_Payment $object
44
- * @param Paymill_Paymill_Model_Transaction $transactionModel Instance of the Transaction Model class
45
- * @return boolean Indicator of success
46
- */
47
- public function setAdditionalInformation(Mage_Sales_Model_Order_Payment $object, Paymill_Paymill_Model_TransactionData $transactionModel)
48
- {
49
- $object->setAdditionalInformation('paymillTransactionId', $transactionModel->getTransactionId());
50
- $object->setAdditionalInformation('paymillPreAuthFlag', $transactionModel->getPreAuthorizationFlag());
51
- Mage::helper('paymill/loggingHelper')->log("Saved Transaction Data.", "Order " . $object->getIncrementId() .
52
- $object->getReservedOrderId(), var_export($object->getAdditionalInformation(), true));
53
-
54
- return true;
55
- }
56
-
57
- /**
58
- * Returns the state of the isPreAuthorization Flag as a boolean
59
- * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
60
- * @return booelean PreAuthorizationFlag
61
- */
62
- public function getPreAuthenticatedFlagState($object)
63
- {
64
- $payment = $object->getPayment();
65
- $transactionObject = $this->getAdditionalInformation($payment);
66
- Mage::helper('paymill/loggingHelper')->log("Read Model from object to return Flag.", var_export($transactionObject, true));
67
- return $transactionObject->getPreAuthorizationFlag();
68
- }
69
-
70
- /**
71
- * Returns the transactionId as a string
72
- * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
73
- * @return String transactionId
74
- */
75
- public function getTransactionId($object)
76
- {
77
- $payment = $object->getPayment();
78
- $transactionObject = $this->getAdditionalInformation($payment);
79
- Mage::helper('paymill/loggingHelper')->log("Read Model from object to return Transaction Id.", var_export($transactionObject, true));
80
- return $transactionObject->getTransactionId();
81
- }
82
-
83
- /**
84
- * Creates a Transaction Model from the given Data
85
- * @param String $transactionId
86
- * @param Boolean $isPreAuthenticated
87
- * @return Paymill_Paymill_Model_TransactionData Model with the desired attributes
88
- */
89
- public function createTransactionModel($transactionId, $isPreAuthenticated = false)
90
- {
91
- $transactionModel = new Paymill_Paymill_Model_TransactionData();
92
- $transactionModel->setTransactionId($transactionId);
93
- $transactionModel->setPreAuthorizationFlag($isPreAuthenticated);
94
- return $transactionModel;
95
- }
96
-
97
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /**
23
+ * The Transaction Helper contains methods dealing saving and loading additional transaction data into and from order objects.
24
+ */
25
+ class Paymill_Paymill_Helper_TransactionHelper extends Mage_Core_Helper_Abstract
26
+ {
27
+
28
+ /**
29
+ * Reads the additional data string from the argumented order object and returns it as an instance of Paymill_Paymill_Model_Transaction
30
+ * @param Mage_Sales_Model_Order_Payment $object
31
+ * @return Paymill_Paymill_Model_TransactionData Transaction Model
32
+ */
33
+ public function getAdditionalInformation(Mage_Sales_Model_Order_Payment $object)
34
+ {
35
+ $transactionId = $object->getAdditionalInformation('paymillTransactionId');
36
+ $preAuthflag = $object->getAdditionalInformation('paymillPreAuthFlag');
37
+ $model = $this->createTransactionModel($transactionId, $preAuthflag);
38
+ return $model;
39
+ }
40
+
41
+ /**
42
+ * Sets the additional Data string of the argumented object to the valueS of the argumented instance of the Paymill_Paymill_Model_Transaction
43
+ * @param Mage_Sales_Model_Order_Payment $object
44
+ * @param Paymill_Paymill_Model_Transaction $transactionModel Instance of the Transaction Model class
45
+ * @return boolean Indicator of success
46
+ */
47
+ public function setAdditionalInformation(Mage_Sales_Model_Order_Payment $object, Paymill_Paymill_Model_TransactionData $transactionModel)
48
+ {
49
+ $object->setAdditionalInformation('paymillTransactionId', $transactionModel->getTransactionId());
50
+ $object->setAdditionalInformation('paymillPreAuthFlag', $transactionModel->getPreAuthorizationFlag());
51
+ Mage::helper('paymill/loggingHelper')->log("Saved Transaction Data.", "Order " . $object->getIncrementId() .
52
+ $object->getReservedOrderId(), var_export($object->getAdditionalInformation(), true));
53
+
54
+ return true;
55
+ }
56
+
57
+ /**
58
+ * Returns the state of the isPreAuthorization Flag as a boolean
59
+ * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
60
+ * @return booelean PreAuthorizationFlag
61
+ */
62
+ public function getPreAuthenticatedFlagState($object)
63
+ {
64
+ $payment = $object->getPayment();
65
+ $transactionObject = $this->getAdditionalInformation($payment);
66
+ Mage::helper('paymill/loggingHelper')->log("Read Model from object to return Flag.", var_export($transactionObject, true));
67
+ return $transactionObject->getPreAuthorizationFlag();
68
+ }
69
+
70
+ /**
71
+ * Returns the transactionId as a string
72
+ * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
73
+ * @return String transactionId
74
+ */
75
+ public function getTransactionId($object)
76
+ {
77
+ $payment = $object->getPayment();
78
+ $transactionObject = $this->getAdditionalInformation($payment);
79
+ Mage::helper('paymill/loggingHelper')->log("Read Model from object to return Transaction Id.", var_export($transactionObject, true));
80
+ return $transactionObject->getTransactionId();
81
+ }
82
+
83
+ /**
84
+ * Creates a Transaction Model from the given Data
85
+ * @param String $transactionId
86
+ * @param Boolean $isPreAuthenticated
87
+ * @return Paymill_Paymill_Model_TransactionData Model with the desired attributes
88
+ */
89
+ public function createTransactionModel($transactionId, $isPreAuthenticated = false)
90
+ {
91
+ $transactionModel = new Paymill_Paymill_Model_TransactionData();
92
+ $transactionModel->setTransactionId($transactionId);
93
+ $transactionModel->setPreAuthorizationFlag($isPreAuthenticated);
94
+ return $transactionModel;
95
+ }
96
+
97
  }
app/code/community/Paymill/Paymill/Model/Fastcheckout.php CHANGED
@@ -1,137 +1,137 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Model_Fastcheckout extends Mage_Core_Model_Abstract
22
- {
23
-
24
- /**
25
- * Construct
26
- */
27
- function _construct()
28
- {
29
- parent::_construct();
30
- $this->_init('paymill/fastcheckout');
31
- }
32
-
33
- /**
34
- * Returns the paymentId matched with the userId passed as an argument.
35
- * If no match is found, the return value will be null.
36
- * @param String $userId Unique identifier of the customer
37
- * @param String $code PaymentMethodCode
38
- * @return String paymentId matched with the userId <b>can be null if no match is found</b>
39
- */
40
- public function getPaymentId($userId, $code)
41
- {
42
- $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
43
- $collection->addFilter('user_id', $userId);
44
- $obj = $collection->getFirstItem();
45
- if ($code === "paymill_creditcard") {
46
- return $obj->getCcPaymentId();
47
- }
48
-
49
- if ($code === "paymill_directdebit") {
50
- return $obj->getElvPaymentId();
51
- }
52
- }
53
-
54
- /**
55
- * Saves a set of arguments (paymentMethodCode, clientId and paymentId) as a match to the Id of the current user.
56
- * The paymentMethodCode is used to bind the Data to the correct payment type.
57
- * @param String $paymentMethodCode $_code from the payment model
58
- * @param String $clientId Code returned from the PaymentProcessor used to recreate the current client object
59
- * @param String $paymentId Code returned from the PaymentProcessor used to recreate the current payment object
60
- * @return boolean Indicator of Success
61
- */
62
- public function saveFcData($paymentMethodCode, $userId, $clientId, $paymentId)
63
- {
64
- $logger = Mage::helper("paymill/loggingHelper");
65
- $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
66
- $collection->addFilter('user_id', $userId);
67
- $customerExists = $collection->count();
68
-
69
- if ($customerExists == 1) {
70
- $obj = $collection->getFirstItem();
71
-
72
- if ($paymentMethodCode === 'paymill_creditcard') {
73
- $logger->log("Saving Fast Checkout Data", "Customer data already exists. Saving CC only Data.");
74
- $obj->setCcPaymentId($paymentId)
75
- ->save();
76
- }
77
-
78
- if ($paymentMethodCode === 'paymill_directdebit') {
79
- $logger->log("Saving Fast Checkout Data", "Customer data already exists. Saving ELV only Data.");
80
- $obj->setElvPaymentId($paymentId)
81
- ->save();
82
- }
83
- return true;
84
- }
85
-
86
- //Insert into db
87
- if ($paymentMethodCode === 'paymill_creditcard') {
88
- $logger->log("Saving Fast Checkout Data", "Customer data saved with CC data");
89
- $this->setId(null)
90
- ->setUserId($userId)
91
- ->setClientId($clientId)
92
- ->setCcPaymentId($paymentId)
93
- ->save();
94
- return true;
95
- }
96
-
97
- if ($paymentMethodCode === 'paymill_directdebit') {
98
- $logger->log("Saving Fast Checkout Data", "Customer data saved with ELV data");
99
- $this->setId(null)
100
- ->setUserId($userId)
101
- ->setClientId($clientId)
102
- ->setElvPaymentId($paymentId)
103
- ->save();
104
- return true;
105
- }
106
-
107
- return false;
108
- }
109
-
110
- /**
111
- * Returns a boolean describing if there is FC Data registered for the given userId
112
- * @param String $userId
113
- * @param String $code PaymentMethodCode
114
- * @return boolean
115
- */
116
- public function hasFcData($userId, $code)
117
- {
118
- $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
119
- $collection->addFilter('user_id', $userId);
120
-
121
- if ($code === "paymill_creditcard") {
122
- $obj = $collection->getFirstItem();
123
- if ($obj->getCcPaymentId() != null) {
124
- return true;
125
- }
126
- }
127
-
128
- if ($code === "paymill_directdebit") {
129
- $obj = $collection->getFirstItem();
130
- if ($obj->getElvPaymentId() != null) {
131
- return true;
132
- }
133
- }
134
- return false;
135
- }
136
-
137
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Model_Fastcheckout extends Mage_Core_Model_Abstract
22
+ {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ function _construct()
28
+ {
29
+ parent::_construct();
30
+ $this->_init('paymill/fastcheckout');
31
+ }
32
+
33
+ /**
34
+ * Returns the paymentId matched with the userId passed as an argument.
35
+ * If no match is found, the return value will be null.
36
+ * @param String $userId Unique identifier of the customer
37
+ * @param String $code PaymentMethodCode
38
+ * @return String paymentId matched with the userId <b>can be null if no match is found</b>
39
+ */
40
+ public function getPaymentId($userId, $code)
41
+ {
42
+ $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
43
+ $collection->addFilter('user_id', $userId);
44
+ $obj = $collection->getFirstItem();
45
+ if ($code === "paymill_creditcard") {
46
+ return $obj->getCcPaymentId();
47
+ }
48
+
49
+ if ($code === "paymill_directdebit") {
50
+ return $obj->getElvPaymentId();
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Saves a set of arguments (paymentMethodCode, clientId and paymentId) as a match to the Id of the current user.
56
+ * The paymentMethodCode is used to bind the Data to the correct payment type.
57
+ * @param String $paymentMethodCode $_code from the payment model
58
+ * @param String $clientId Code returned from the PaymentProcessor used to recreate the current client object
59
+ * @param String $paymentId Code returned from the PaymentProcessor used to recreate the current payment object
60
+ * @return boolean Indicator of Success
61
+ */
62
+ public function saveFcData($paymentMethodCode, $userId, $clientId, $paymentId)
63
+ {
64
+ $logger = Mage::helper("paymill/loggingHelper");
65
+ $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
66
+ $collection->addFilter('user_id', $userId);
67
+ $customerExists = $collection->count();
68
+
69
+ if ($customerExists == 1) {
70
+ $obj = $collection->getFirstItem();
71
+
72
+ if ($paymentMethodCode === 'paymill_creditcard') {
73
+ $logger->log("Saving Fast Checkout Data", "Customer data already exists. Saving CC only Data.");
74
+ $obj->setCcPaymentId($paymentId)
75
+ ->save();
76
+ }
77
+
78
+ if ($paymentMethodCode === 'paymill_directdebit') {
79
+ $logger->log("Saving Fast Checkout Data", "Customer data already exists. Saving ELV only Data.");
80
+ $obj->setElvPaymentId($paymentId)
81
+ ->save();
82
+ }
83
+ return true;
84
+ }
85
+
86
+ //Insert into db
87
+ if ($paymentMethodCode === 'paymill_creditcard') {
88
+ $logger->log("Saving Fast Checkout Data", "Customer data saved with CC data");
89
+ $this->setId(null)
90
+ ->setUserId($userId)
91
+ ->setClientId($clientId)
92
+ ->setCcPaymentId($paymentId)
93
+ ->save();
94
+ return true;
95
+ }
96
+
97
+ if ($paymentMethodCode === 'paymill_directdebit') {
98
+ $logger->log("Saving Fast Checkout Data", "Customer data saved with ELV data");
99
+ $this->setId(null)
100
+ ->setUserId($userId)
101
+ ->setClientId($clientId)
102
+ ->setElvPaymentId($paymentId)
103
+ ->save();
104
+ return true;
105
+ }
106
+
107
+ return false;
108
+ }
109
+
110
+ /**
111
+ * Returns a boolean describing if there is FC Data registered for the given userId
112
+ * @param String $userId
113
+ * @param String $code PaymentMethodCode
114
+ * @return boolean
115
+ */
116
+ public function hasFcData($userId, $code)
117
+ {
118
+ $collection = Mage::getModel('paymill/fastcheckout')->getCollection();
119
+ $collection->addFilter('user_id', $userId);
120
+
121
+ if ($code === "paymill_creditcard") {
122
+ $obj = $collection->getFirstItem();
123
+ if ($obj->getCcPaymentId() != null) {
124
+ return true;
125
+ }
126
+ }
127
+
128
+ if ($code === "paymill_directdebit") {
129
+ $obj = $collection->getFirstItem();
130
+ if ($obj->getElvPaymentId() != null) {
131
+ return true;
132
+ }
133
+ }
134
+ return false;
135
+ }
136
+
137
  }
app/code/community/Paymill/Paymill/Model/Log.php CHANGED
@@ -1,52 +1,52 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Model_Log extends Mage_Core_Model_Abstract
22
- {
23
-
24
- /**
25
- * Construct
26
- */
27
- function _construct()
28
- {
29
- parent::_construct();
30
- $this->_init('paymill/log');
31
- }
32
-
33
- /**
34
- * Inserts the arguments into the db log
35
- * @param String $merchantInfo
36
- * @param String $devInfo
37
- * @param String $devInfoAdditional
38
- */
39
- public function log($merchantInfo, $devInfo, $devInfoAdditional = null)
40
- {
41
- if (Mage::helper("paymill/optionHelper")->isLogging()) {
42
- $this->setId(null)
43
- ->setEntryDate(null)
44
- ->setVersion(Mage::helper("paymill")->getVersion())
45
- ->setMerchantInfo($merchantInfo)
46
- ->setDevInfo($devInfo)
47
- ->setDevInfoAdditional($devInfoAdditional)
48
- ->save();
49
- }
50
- }
51
-
52
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Model_Log extends Mage_Core_Model_Abstract
22
+ {
23
+
24
+ /**
25
+ * Construct
26
+ */
27
+ function _construct()
28
+ {
29
+ parent::_construct();
30
+ $this->_init('paymill/log');
31
+ }
32
+
33
+ /**
34
+ * Inserts the arguments into the db log
35
+ * @param String $merchantInfo
36
+ * @param String $devInfo
37
+ * @param String $devInfoAdditional
38
+ */
39
+ public function log($merchantInfo, $devInfo, $devInfoAdditional = null)
40
+ {
41
+ if (Mage::helper("paymill/optionHelper")->isLogging()) {
42
+ $this->setId(null)
43
+ ->setEntryDate(null)
44
+ ->setVersion(Mage::helper("paymill")->getVersion())
45
+ ->setMerchantInfo($merchantInfo)
46
+ ->setDevInfo($devInfo)
47
+ ->setDevInfoAdditional($devInfoAdditional)
48
+ ->save();
49
+ }
50
+ }
51
+
52
  }
app/code/community/Paymill/Paymill/Model/Method/MethodModelAbstract.php CHANGED
@@ -1,250 +1,253 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- abstract class Paymill_Paymill_Model_Method_MethodModelAbstract extends Mage_Payment_Model_Method_Abstract
22
- {
23
-
24
- /**
25
- * Is method a gateaway
26
- *
27
- * @var boolean
28
- */
29
- protected $_isGateway = false;
30
-
31
- /**
32
- * Can use the Authorize method
33
- *
34
- * @var boolean
35
- */
36
- protected $_canAuthorize = true;
37
-
38
- /**
39
- * Can use the Refund method
40
- *
41
- * @var boolean
42
- */
43
- protected $_canRefund = true;
44
-
45
- /**
46
- * Can use the Refund method to refund less than the full amount
47
- *
48
- * @var boolean
49
- */
50
- protected $_canRefundInvoicePartial = true;
51
-
52
- /**
53
- * Can use the Capture method
54
- *
55
- * @var boolean
56
- */
57
- protected $_canCapture = true;
58
-
59
- /**
60
- * Can this method use for checkout
61
- *
62
- * @var boolean
63
- */
64
- protected $_canUseCheckout = true;
65
-
66
- /**
67
- * Can this method use for multishipping
68
- *
69
- * @var boolean
70
- */
71
- protected $_canUseForMultishipping = false;
72
-
73
- /**
74
- * Is a initalize needed
75
- *
76
- * @var boolean
77
- */
78
- protected $_isInitializeNeeded = false;
79
-
80
- /**
81
- * Payment Title
82
- *
83
- * @var type
84
- */
85
- protected $_methodTitle = '';
86
-
87
- /**
88
- * Magento method code
89
- *
90
- * @var string
91
- */
92
- protected $_code = 'paymill_abstract';
93
-
94
- /**
95
- * Check if currency is avaible for this payment
96
- *
97
- * @param string $currencyCode
98
- * @return boolean
99
- */
100
- public function canUseForCurrency($currencyCode)
101
- {
102
- $quote = Mage::getSingleton('checkout/session')->getQuote();
103
- $storeId = $quote ? $quote->getStoreId() : null;
104
-
105
- $availableCurrencies = explode(',', $this->getConfigData('currency', $storeId));
106
- if (!in_array($currencyCode, $availableCurrencies)) {
107
- return false;
108
- }
109
- return true;
110
- }
111
-
112
- /**
113
- * Defines if the payment method is available for checkout
114
- * @param Mage_Sales_Model_Quote $quote
115
- * @return boolean
116
- */
117
- public function isAvailable($quote = null)
118
- {
119
- $keysAreSet = Mage::helper("paymill")->isPublicKeySet() && Mage::helper("paymill")->isPrivateKeySet();
120
- return parent::isAvailable($quote) && $keysAreSet;
121
- }
122
-
123
- /**
124
- * Return Quote or Order Object depending on the type of the payment info
125
- *
126
- * @return Mage_Sales_Model_Order
127
- */
128
- public function getOrder()
129
- {
130
- $paymentInfo = $this->getInfoInstance();
131
-
132
- if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
133
- return $paymentInfo->getOrder();
134
- }
135
-
136
- return $paymentInfo->getQuote();
137
- }
138
-
139
- /**
140
- * Get the title of every payment option with payment fee if available
141
- *
142
- * @return string
143
- */
144
- public function getTitle()
145
- {
146
- $quote = Mage::getSingleton('checkout/session')->getQuote();
147
- $storeId = $quote ? $quote->getStoreId() : null;
148
-
149
- return $this->_getHelper()->__($this->getConfigData('title', $storeId));
150
- }
151
-
152
- /**
153
- * Assing data to information model object for fast checkout
154
- * Saves Session Variables.
155
- * @param mixed $data
156
- */
157
- public function assignData($data)
158
- {
159
- //Recieve Data
160
- $postData = Mage::app()->getRequest()->getPost();
161
- $token = $postData['payment']['paymill-payment-token'];
162
-
163
- //Save Data into session
164
- Mage::getSingleton('core/session')->setToken($token);
165
- Mage::getSingleton('core/session')->setPaymentCode($this->getCode());
166
-
167
- //Finish as usual
168
- return parent::assignData($data);
169
- }
170
-
171
- /**
172
- * Gets Excecuted when the checkout button is pressed.
173
- * @param Varien_Object $payment
174
- * @param float $amount
175
- * @throws Exception
176
- */
177
- public function authorize(Varien_Object $payment, $amount)
178
- {
179
- $success = false;
180
- if (Mage::helper('paymill/optionHelper')->isPreAuthorizing() && $this->_code === "paymill_creditcard") {
181
- Mage::helper('paymill/loggingHelper')->log("Starting payment process as preAuth");
182
- $success = $this->preAuth($payment, $amount);
183
- } else {
184
- Mage::helper('paymill/loggingHelper')->log("Starting payment process as debit");
185
- $success = $this->debit($payment, $amount);
186
- }
187
-
188
- if (!$success) {
189
- Mage::helper('paymill/loggingHelper')->log("There was an error processing the payment.");
190
- Mage::getSingleton('checkout/session')->setGotoSection('payment');
191
- Mage::throwException("There was an error processing your payment.");
192
- }
193
- //Finish as usual
194
- return parent::authorize($payment, $amount);
195
- }
196
-
197
- /**
198
- * Deals with payment processing when debit mode is active
199
- * @return booelan Indicator of success
200
- */
201
- public function debit(Varien_Object $payment, $amount)
202
- {
203
- //Gathering data from session
204
- $token = Mage::getSingleton('core/session')->getToken();
205
- $quote = Mage::getSingleton('checkout/session')->getQuote();
206
-
207
- //Create Payment Processor
208
- $paymentHelper = Mage::helper("paymill/paymentHelper");
209
- $fcHelper = Mage::helper("paymill/fastCheckoutHelper");
210
- $paymentProcessor = $paymentHelper->createPaymentProcessor($this->getCode(), $token);
211
- $paymentProcessor->setPreAuthAmount(Mage::getSingleton('core/session')->getPreAuthAmount());
212
-
213
- //Loading Fast Checkout Data (if enabled and given)
214
- if ($fcHelper->isFastCheckoutEnabled()) {
215
- $clientId = $fcHelper->getClientId();
216
- if (isset($clientId)) {
217
- $paymentProcessor->setClientId($clientId);
218
- $paymentId = $fcHelper->getPaymentId($this->_code);
219
- if (isset($paymentId)) {
220
- $paymentProcessor->setPaymentId($paymentId);
221
- }
222
- }
223
- }
224
-
225
- //Process Payment
226
- $success = $paymentProcessor->processPayment();
227
-
228
-
229
- If ($success) {
230
- //Save Transaction Data
231
- $transactionHelper = Mage::helper("paymill/transactionHelper");
232
- $transactionModel = $transactionHelper->createTransactionModel($paymentProcessor->getTransactionId(), false);
233
- $transactionHelper->setAdditionalInformation($payment, $transactionModel);
234
-
235
- //Save Data for Fast Checkout (if enabled)
236
- if ($fcHelper->isFastCheckoutEnabled()) { //Fast checkout enabled
237
- if (!$fcHelper->hasData($this->_code)) {
238
- $clientId = $paymentProcessor->getClientId();
239
- $paymentId = $paymentProcessor->getPaymentId();
240
- $fcHelper->saveData($this->_code, $clientId, $paymentId);
241
- }
242
- }
243
-
244
- return true;
245
- }
246
-
247
- return false;
248
- }
249
-
 
 
 
250
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ abstract class Paymill_Paymill_Model_Method_MethodModelAbstract extends Mage_Payment_Model_Method_Abstract
22
+ {
23
+
24
+ /**
25
+ * Is method a gateaway
26
+ *
27
+ * @var boolean
28
+ */
29
+ protected $_isGateway = false;
30
+
31
+ /**
32
+ * Can use the Authorize method
33
+ *
34
+ * @var boolean
35
+ */
36
+ protected $_canAuthorize = true;
37
+
38
+ /**
39
+ * Can use the Refund method
40
+ *
41
+ * @var boolean
42
+ */
43
+ protected $_canRefund = true;
44
+
45
+ /**
46
+ * Can use the Refund method to refund less than the full amount
47
+ *
48
+ * @var boolean
49
+ */
50
+ protected $_canRefundInvoicePartial = true;
51
+
52
+ /**
53
+ * Can use the Capture method
54
+ *
55
+ * @var boolean
56
+ */
57
+ protected $_canCapture = true;
58
+
59
+ /**
60
+ * Can this method use for checkout
61
+ *
62
+ * @var boolean
63
+ */
64
+ protected $_canUseCheckout = true;
65
+
66
+ /**
67
+ * Can this method use for multishipping
68
+ *
69
+ * @var boolean
70
+ */
71
+ protected $_canUseForMultishipping = false;
72
+
73
+ /**
74
+ * Is a initalize needed
75
+ *
76
+ * @var boolean
77
+ */
78
+ protected $_isInitializeNeeded = false;
79
+
80
+ /**
81
+ * Payment Title
82
+ *
83
+ * @var type
84
+ */
85
+ protected $_methodTitle = '';
86
+
87
+ /**
88
+ * Magento method code
89
+ *
90
+ * @var string
91
+ */
92
+ protected $_code = 'paymill_abstract';
93
+
94
+ /**
95
+ * Check if currency is avaible for this payment
96
+ *
97
+ * @param string $currencyCode
98
+ * @return boolean
99
+ */
100
+ public function canUseForCurrency($currencyCode)
101
+ {
102
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
103
+ $storeId = $quote ? $quote->getStoreId() : null;
104
+
105
+ $availableCurrencies = explode(',', $this->getConfigData('currency', $storeId));
106
+ if (!in_array($currencyCode, $availableCurrencies)) {
107
+ return false;
108
+ }
109
+ return true;
110
+ }
111
+
112
+ /**
113
+ * Defines if the payment method is available for checkout
114
+ * @param Mage_Sales_Model_Quote $quote
115
+ * @return boolean
116
+ */
117
+ public function isAvailable($quote = null)
118
+ {
119
+ $keysAreSet = Mage::helper("paymill")->isPublicKeySet() && Mage::helper("paymill")->isPrivateKeySet();
120
+ return parent::isAvailable($quote) && $keysAreSet;
121
+ }
122
+
123
+ /**
124
+ * Return Quote or Order Object depending on the type of the payment info
125
+ *
126
+ * @return Mage_Sales_Model_Order
127
+ */
128
+ public function getOrder()
129
+ {
130
+ $paymentInfo = $this->getInfoInstance();
131
+
132
+ if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {
133
+ return $paymentInfo->getOrder();
134
+ }
135
+
136
+ return $paymentInfo->getQuote();
137
+ }
138
+
139
+ /**
140
+ * Get the title of every payment option with payment fee if available
141
+ *
142
+ * @return string
143
+ */
144
+ public function getTitle()
145
+ {
146
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
147
+ $storeId = $quote ? $quote->getStoreId() : null;
148
+
149
+ return $this->_getHelper()->__($this->getConfigData('title', $storeId));
150
+ }
151
+
152
+ /**
153
+ * Assing data to information model object for fast checkout
154
+ * Saves Session Variables.
155
+ * @param mixed $data
156
+ */
157
+ public function assignData($data)
158
+ {
159
+ $post = $data->getData();
160
+ if (!array_key_exists('paymill-payment-token', $post)
161
+ || empty($post['paymill-payment-token'])) {
162
+ Mage::helper('paymill/loggingHelper')->log("No token found.");
163
+ Mage::throwException("There was an error processing your payment.");
164
+ }
165
+
166
+ //Save Data into session
167
+ Mage::getSingleton('core/session')->setToken($post['paymill-payment-token']);
168
+ Mage::getSingleton('core/session')->setPaymentCode($this->getCode());
169
+
170
+ //Finish as usual
171
+ return parent::assignData($data);
172
+ }
173
+
174
+ /**
175
+ * Gets Excecuted when the checkout button is pressed.
176
+ * @param Varien_Object $payment
177
+ * @param float $amount
178
+ * @throws Exception
179
+ */
180
+ public function authorize(Varien_Object $payment, $amount)
181
+ {
182
+ $success = false;
183
+ if (Mage::helper('paymill/optionHelper')->isPreAuthorizing() && $this->_code === "paymill_creditcard") {
184
+ Mage::helper('paymill/loggingHelper')->log("Starting payment process as preAuth");
185
+ $success = $this->preAuth($payment, $amount);
186
+ } else {
187
+ Mage::helper('paymill/loggingHelper')->log("Starting payment process as debit");
188
+ $success = $this->debit($payment, $amount);
189
+ }
190
+
191
+ if (!$success) {
192
+ Mage::helper('paymill/loggingHelper')->log("There was an error processing the payment.");
193
+ Mage::getSingleton('checkout/session')->setGotoSection('payment');
194
+ Mage::throwException("There was an error processing your payment.");
195
+ }
196
+ //Finish as usual
197
+ return parent::authorize($payment, $amount);
198
+ }
199
+
200
+ /**
201
+ * Deals with payment processing when debit mode is active
202
+ * @return booelan Indicator of success
203
+ */
204
+ public function debit(Varien_Object $payment, $amount)
205
+ {
206
+ //Gathering data from session
207
+ $token = Mage::getSingleton('core/session')->getToken();
208
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
209
+
210
+ //Create Payment Processor
211
+ $paymentHelper = Mage::helper("paymill/paymentHelper");
212
+ $fcHelper = Mage::helper("paymill/fastCheckoutHelper");
213
+ $paymentProcessor = $paymentHelper->createPaymentProcessor($this->getCode(), $token);
214
+ $paymentProcessor->setPreAuthAmount(Mage::getSingleton('core/session')->getPreAuthAmount());
215
+
216
+ //Loading Fast Checkout Data (if enabled and given)
217
+ if ($fcHelper->isFastCheckoutEnabled()) {
218
+ $clientId = $fcHelper->getClientId();
219
+ if (isset($clientId)) {
220
+ $paymentProcessor->setClientId($clientId);
221
+ $paymentId = $fcHelper->getPaymentId($this->_code);
222
+ if (isset($paymentId)) {
223
+ $paymentProcessor->setPaymentId($paymentId);
224
+ }
225
+ }
226
+ }
227
+
228
+ //Process Payment
229
+ $success = $paymentProcessor->processPayment();
230
+
231
+
232
+ If ($success) {
233
+ //Save Transaction Data
234
+ $transactionHelper = Mage::helper("paymill/transactionHelper");
235
+ $transactionModel = $transactionHelper->createTransactionModel($paymentProcessor->getTransactionId(), false);
236
+ $transactionHelper->setAdditionalInformation($payment, $transactionModel);
237
+
238
+ //Save Data for Fast Checkout (if enabled)
239
+ if ($fcHelper->isFastCheckoutEnabled()) { //Fast checkout enabled
240
+ if (!$fcHelper->hasData($this->_code)) {
241
+ $clientId = $paymentProcessor->getClientId();
242
+ $paymentId = $paymentProcessor->getPaymentId();
243
+ $fcHelper->saveData($this->_code, $clientId, $paymentId);
244
+ }
245
+ }
246
+
247
+ return true;
248
+ }
249
+
250
+ return false;
251
+ }
252
+
253
  }
app/code/community/Paymill/Paymill/Model/Method/MethodModelCreditcard.php CHANGED
@@ -1,130 +1,135 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Model_Method_MethodModelCreditcard extends Paymill_Paymill_Model_Method_MethodModelAbstract
22
- {
23
-
24
- /**
25
- * Magento method code
26
- *
27
- * @var string
28
- */
29
- protected $_code = "paymill_creditcard";
30
-
31
- /**
32
- * Form block identifier
33
- *
34
- * @var string
35
- */
36
- protected $_formBlockType = 'paymill/payment_form_paymentFormCreditcard';
37
-
38
- /**
39
- * Info block identifier
40
- *
41
- * @var string
42
- */
43
- protected $_infoBlockType = 'paymill/payment_info_paymentFormCreditcard';
44
-
45
- /**
46
- * Deals with payment processing when preAuth mode is active
47
- */
48
- public function preAuth(Varien_Object $payment, $amount)
49
- {
50
- //Gathering data from session
51
- $token = Mage::getSingleton('core/session')->getToken();
52
-
53
- //Create Payment Processor
54
- $paymentHelper = Mage::helper("paymill/paymentHelper");
55
- $fcHelper = Mage::helper("paymill/fastCheckoutHelper");
56
- $paymentProcessor = $paymentHelper->createPaymentProcessor($this->getCode(), $token);
57
- $paymentProcessor->setPreAuthAmount(Mage::getSingleton('core/session')->getPreAuthAmount());
58
-
59
- //Loading Fast Checkout Data (if enabled and given)
60
- if ($fcHelper->isFastCheckoutEnabled()) {
61
- $clientId = $fcHelper->getClientId();
62
- if (isset($clientId)) {
63
- $paymentProcessor->setClientId($clientId);
64
- $paymentId = $fcHelper->getPaymentId($this->_code);
65
- if (isset($paymentId)) {
66
- $paymentProcessor->setPaymentId($paymentId);
67
- }
68
- }
69
- }
70
-
71
- //Process Payment
72
- $success = $paymentProcessor->processPayment(false);
73
-
74
- If ($success) {
75
- //Save Transaction Data
76
- $transactionHelper = Mage::helper("paymill/transactionHelper");
77
- $transactionModel = $transactionHelper->createTransactionModel($paymentProcessor->getPreauthId(), true);
78
- $transactionHelper->setAdditionalInformation($payment, $transactionModel);
79
-
80
- //Save Data for Fast Checkout (if enabled)
81
- if ($fcHelper->isFastCheckoutEnabled()) { //Fast checkout enabled
82
- if (!$fcHelper->hasData($this->_code)) {
83
- $clientId = $paymentProcessor->getClientId();
84
- $paymentId = $paymentProcessor->getPaymentId();
85
- $fcHelper->saveData($this->_code, $clientId, $paymentId);
86
- }
87
- }
88
-
89
- return true;
90
- }
91
-
92
- return false;
93
- }
94
-
95
- /**
96
- * Gets called when a capture gets triggered (default on invoice generation)
97
- */
98
- public function capture(Varien_Object $payment, $amount)
99
- {
100
- //Initalizing variables and helpers
101
- $transactionHelper = Mage::helper("paymill/transactionHelper");
102
- $order = $payment->getOrder();
103
-
104
- if ($transactionHelper->getPreAuthenticatedFlagState($order)) {
105
- //Capture preAuth
106
- $preAuthorization = $transactionHelper->getTransactionId($order);
107
- $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
108
- $apiUrl = Mage::helper('paymill')->getApiUrl();
109
- $libBase = null;
110
-
111
- $params = array();
112
- $params['amount'] = (int) (string) ($amount * 100);
113
- $params['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
114
- $params['description'] = Mage::helper('paymill/paymentHelper')->getDescription($order);
115
- $params['source'] = Mage::helper('paymill')->getSourceString();
116
-
117
- $paymentProcessor = new Services_Paymill_PaymentProcessor($privateKey, $apiUrl, $libBase, $params, Mage::helper('paymill/loggingHelper'));
118
- $paymentProcessor->setPreauthId($preAuthorization);
119
- $paymentProcessor->capture();
120
-
121
- Mage::helper('paymill/loggingHelper')->log("Capture created", var_export($paymentProcessor->getLastResponse(), true));
122
-
123
- //Save Transaction Data
124
- $transactionId = $paymentProcessor->getTransactionId();
125
- $transactionModel = $transactionHelper->createTransactionModel($transactionId, true);
126
- $transactionHelper->setAdditionalInformation($payment, $transactionModel);
127
- }
128
- }
129
-
130
- }
 
 
 
 
 
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Model_Method_MethodModelCreditcard extends Paymill_Paymill_Model_Method_MethodModelAbstract
22
+ {
23
+
24
+ /**
25
+ * Magento method code
26
+ *
27
+ * @var string
28
+ */
29
+ protected $_code = "paymill_creditcard";
30
+
31
+ /**
32
+ * Form block identifier
33
+ *
34
+ * @var string
35
+ */
36
+ protected $_formBlockType = 'paymill/payment_form_paymentFormCreditcard';
37
+
38
+ /**
39
+ * Info block identifier
40
+ *
41
+ * @var string
42
+ */
43
+ protected $_infoBlockType = 'paymill/payment_info_paymentFormCreditcard';
44
+
45
+ /**
46
+ * Deals with payment processing when preAuth mode is active
47
+ */
48
+ public function preAuth(Varien_Object $payment, $amount)
49
+ {
50
+ //Gathering data from session
51
+ $token = Mage::getSingleton('core/session')->getToken();
52
+
53
+ //Create Payment Processor
54
+ $paymentHelper = Mage::helper("paymill/paymentHelper");
55
+ $fcHelper = Mage::helper("paymill/fastCheckoutHelper");
56
+ $paymentProcessor = $paymentHelper->createPaymentProcessor($this->getCode(), $token);
57
+ $paymentProcessor->setPreAuthAmount(Mage::getSingleton('core/session')->getPreAuthAmount());
58
+
59
+ //Loading Fast Checkout Data (if enabled and given)
60
+ if ($fcHelper->isFastCheckoutEnabled()) {
61
+ $clientId = $fcHelper->getClientId();
62
+ if (isset($clientId)) {
63
+ $paymentProcessor->setClientId($clientId);
64
+ $paymentId = $fcHelper->getPaymentId($this->_code);
65
+ if (isset($paymentId)) {
66
+ $paymentProcessor->setPaymentId($paymentId);
67
+ }
68
+ }
69
+ }
70
+
71
+ //Process Payment
72
+ $success = $paymentProcessor->processPayment(false);
73
+
74
+ If ($success) {
75
+ //Save Transaction Data
76
+ $transactionHelper = Mage::helper("paymill/transactionHelper");
77
+ $transactionModel = $transactionHelper->createTransactionModel($paymentProcessor->getPreauthId(), true);
78
+ $transactionHelper->setAdditionalInformation($payment, $transactionModel);
79
+
80
+ //Save Data for Fast Checkout (if enabled)
81
+ if ($fcHelper->isFastCheckoutEnabled()) { //Fast checkout enabled
82
+ if (!$fcHelper->hasData($this->_code)) {
83
+ $clientId = $paymentProcessor->getClientId();
84
+ $paymentId = $paymentProcessor->getPaymentId();
85
+ $fcHelper->saveData($this->_code, $clientId, $paymentId);
86
+ }
87
+ }
88
+
89
+ return true;
90
+ }
91
+
92
+ return false;
93
+ }
94
+
95
+ /**
96
+ * Gets called when a capture gets triggered (default on invoice generation)
97
+ *
98
+ * @throws Exception
99
+ */
100
+ public function capture(Varien_Object $payment, $amount)
101
+ {
102
+ //Initalizing variables and helpers
103
+ $transactionHelper = Mage::helper("paymill/transactionHelper");
104
+ $order = $payment->getOrder();
105
+
106
+ if ($transactionHelper->getPreAuthenticatedFlagState($order)) {
107
+ //Capture preAuth
108
+ $preAuthorization = $transactionHelper->getTransactionId($order);
109
+ $privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
110
+ $apiUrl = Mage::helper('paymill')->getApiUrl();
111
+ $libBase = null;
112
+
113
+ $params = array();
114
+ $params['amount'] = (int) (string) ($amount * 100);
115
+ $params['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
116
+ $params['description'] = Mage::helper('paymill/paymentHelper')->getDescription($order);
117
+ $params['source'] = Mage::helper('paymill')->getSourceString();
118
+
119
+ $paymentProcessor = new Services_Paymill_PaymentProcessor($privateKey, $apiUrl, $libBase, $params, Mage::helper('paymill/loggingHelper'));
120
+ $paymentProcessor->setPreauthId($preAuthorization);
121
+
122
+ if (!$paymentProcessor->capture()) {
123
+ Mage::throwException("There was an error processing your capture.");
124
+ }
125
+
126
+ Mage::helper('paymill/loggingHelper')->log("Capture created", var_export($paymentProcessor->getLastResponse(), true));
127
+
128
+ //Save Transaction Data
129
+ $transactionId = $paymentProcessor->getTransactionId();
130
+ $transactionModel = $transactionHelper->createTransactionModel($transactionId, true);
131
+ $transactionHelper->setAdditionalInformation($payment, $transactionModel);
132
+ }
133
+ }
134
+
135
+ }
app/code/community/Paymill/Paymill/Model/Method/MethodModelDirectdebit.php CHANGED
@@ -1,45 +1,45 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Model_Method_MethodModelDirectdebit extends Paymill_Paymill_Model_Method_MethodModelAbstract
22
- {
23
-
24
- /**
25
- * Magento method code
26
- *
27
- * @var string
28
- */
29
- protected $_code = "paymill_directdebit";
30
-
31
- /**
32
- * Form block identifier
33
- *
34
- * @var string
35
- */
36
- protected $_formBlockType = 'paymill/payment_form_paymentFormDirectdebit';
37
-
38
- /**
39
- * Info block identifier
40
- *
41
- * @var string
42
- */
43
- protected $_infoBlockType = 'paymill/payment_info_paymentFormDirectdebit';
44
-
45
- }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Model_Method_MethodModelDirectdebit extends Paymill_Paymill_Model_Method_MethodModelAbstract
22
+ {
23
+
24
+ /**
25
+ * Magento method code
26
+ *
27
+ * @var string
28
+ */
29
+ protected $_code = "paymill_directdebit";
30
+
31
+ /**
32
+ * Form block identifier
33
+ *
34
+ * @var string
35
+ */
36
+ protected $_formBlockType = 'paymill/payment_form_paymentFormDirectdebit';
37
+
38
+ /**
39
+ * Info block identifier
40
+ *
41
+ * @var string
42
+ */
43
+ protected $_infoBlockType = 'paymill/payment_info_paymentFormDirectdebit';
44
+
45
+ }
app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Paymill
16
- * @package Paymill_Paymill
17
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
- */
20
- class Paymill_Paymill_Model_Mysql4_Fastcheckout extends Mage_Core_Model_Mysql4_Abstract
21
- {
22
-
23
- /**
24
- * Construct
25
- */
26
- function _construct()
27
- {
28
- $this->_init('paymill/fastcheckout', 'id');
29
- }
30
  }
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Paymill
16
+ * @package Paymill_Paymill
17
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ class Paymill_Paymill_Model_Mysql4_Fastcheckout extends Mage_Core_Model_Mysql4_Abstract
21
+ {
22
+
23
+ /**
24
+ * Construct
25
+ */
26
+ function _construct()
27
+ {
28
+ $this->_init('paymill/fastcheckout', 'id');
29
+ }
30
  }
app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout/Collection.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Paymill
16
- * @package Paymill_Paymill
17
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
- */
20
- class Paymill_Paymill_Model_Mysql4_FastCheckout_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
21
- {
22
- /**
23
- * Construct
24
- */
25
- public function _construct()
26
- {
27
- parent::_construct();
28
- $this->_init('paymill/fastcheckout');
29
- }
30
  }
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Paymill
16
+ * @package Paymill_Paymill
17
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ class Paymill_Paymill_Model_Mysql4_FastCheckout_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
21
+ {
22
+ /**
23
+ * Construct
24
+ */
25
+ public function _construct()
26
+ {
27
+ parent::_construct();
28
+ $this->_init('paymill/fastcheckout');
29
+ }
30
  }
app/code/community/Paymill/Paymill/Model/Mysql4/Log.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Paymill
16
- * @package Paymill_Paymill
17
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
- */
20
- class Paymill_Paymill_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
21
- {
22
-
23
- /**
24
- * Construct
25
- */
26
- function _construct()
27
- {
28
- $this->_init('paymill/log', 'id');
29
- }
30
  }
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Paymill
16
+ * @package Paymill_Paymill
17
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ class Paymill_Paymill_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
21
+ {
22
+
23
+ /**
24
+ * Construct
25
+ */
26
+ function _construct()
27
+ {
28
+ $this->_init('paymill/log', 'id');
29
+ }
30
  }
app/code/community/Paymill/Paymill/Model/Mysql4/Log/Collection.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Paymill
16
- * @package Paymill_Paymill
17
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
- */
20
- class Paymill_Paymill_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
21
- {
22
- /**
23
- * Construct
24
- */
25
- public function _construct()
26
- {
27
- parent::_construct();
28
- $this->_init('paymill/log');
29
- }
30
  }
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Paymill
16
+ * @package Paymill_Paymill
17
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ class Paymill_Paymill_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
21
+ {
22
+ /**
23
+ * Construct
24
+ */
25
+ public function _construct()
26
+ {
27
+ parent::_construct();
28
+ $this->_init('paymill/log');
29
+ }
30
  }
app/code/community/Paymill/Paymill/Model/Observer.php CHANGED
@@ -1,73 +1,73 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Model_Observer
22
- {
23
-
24
- /**
25
- * Registered for the checkout_onepage_controller_success_action event
26
- * Generates the invoice for the current order
27
- *
28
- * @param Varien_Event_Observer $observer
29
- */
30
- public function generateInvoice(Varien_Event_Observer $observer)
31
- {
32
- $orderIds = $observer->getEvent()->getOrderIds();
33
- if ($orderIds) {
34
- $orderId = current($orderIds);
35
- if (!$orderId) {
36
- return;
37
- }
38
- }
39
- $order = Mage::getModel('sales/order')->load($orderId);
40
- $paymentCode = $order->getPayment()->getMethod();
41
- if ($paymentCode === 'paymill_creditcard' || $paymentCode === 'paymill_directdebit') {
42
-
43
- if (Mage::helper('paymill/transactionHelper')->getPreAuthenticatedFlagState($order)) { // If the transaction is not flagged as a debit (not a preAuth) transaction
44
- Mage::helper('paymill/loggingHelper')->log("Debug", "No Invoice generated, since the transaction is flagged as preauth");
45
- } else {
46
- if ($order->canInvoice()) {
47
- //Create the Invoice
48
- Mage::helper('paymill/loggingHelper')->log(Mage::helper('paymill')->__($paymentCode), Mage::helper('paymill')->__('paymill_checkout_generating_invoice'), "Order Id: " . $order->getIncrementId());
49
- $invoiceId = Mage::getModel('sales/order_invoice_api')->create($order->getIncrementId(), array());
50
- Mage::getModel('sales/order_invoice_api')->capture($invoiceId);
51
- }
52
- }
53
- }
54
- }
55
-
56
- /**
57
- * Registered for the sales_order_creditmemo_refund event
58
- * Creates a refund based on the created creditmemo
59
- * @param Varien_Event_Observer $observer
60
- */
61
- public function refundCreditmemo(Varien_Event_Observer $observer)
62
- {
63
- $creditmemo = $observer->getEvent()->getCreditmemo();
64
- $order = $creditmemo->getOrder();
65
- if ($order->getPayment()->getMethod() === 'paymill_creditcard' || $order->getPayment()->getMethod() === 'paymill_directdebit') {
66
- $amount = (int) ((string) ($creditmemo->getGrandTotal() * 100));
67
- Mage::helper('paymill/loggingHelper')->log("Trying to Refund.", var_export($order->getIncrementId(), true), $amount);
68
- Mage::helper('paymill/refundHelper')->createRefund($order, $amount);
69
- }
70
- }
71
-
72
- }
73
-
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Model_Observer
22
+ {
23
+
24
+ /**
25
+ * Registered for the checkout_onepage_controller_success_action event
26
+ * Generates the invoice for the current order
27
+ *
28
+ * @param Varien_Event_Observer $observer
29
+ */
30
+ public function generateInvoice(Varien_Event_Observer $observer)
31
+ {
32
+ $orderIds = $observer->getEvent()->getOrderIds();
33
+ if ($orderIds) {
34
+ $orderId = current($orderIds);
35
+ if (!$orderId) {
36
+ return;
37
+ }
38
+ }
39
+ $order = Mage::getModel('sales/order')->load($orderId);
40
+ $paymentCode = $order->getPayment()->getMethod();
41
+ if ($paymentCode === 'paymill_creditcard' || $paymentCode === 'paymill_directdebit') {
42
+
43
+ if (Mage::helper('paymill/transactionHelper')->getPreAuthenticatedFlagState($order)) { // If the transaction is not flagged as a debit (not a preAuth) transaction
44
+ Mage::helper('paymill/loggingHelper')->log("Debug", "No Invoice generated, since the transaction is flagged as preauth");
45
+ } else {
46
+ if ($order->canInvoice()) {
47
+ //Create the Invoice
48
+ Mage::helper('paymill/loggingHelper')->log(Mage::helper('paymill')->__($paymentCode), Mage::helper('paymill')->__('paymill_checkout_generating_invoice'), "Order Id: " . $order->getIncrementId());
49
+ $invoiceId = Mage::getModel('sales/order_invoice_api')->create($order->getIncrementId(), array());
50
+ Mage::getModel('sales/order_invoice_api')->capture($invoiceId);
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Registered for the sales_order_creditmemo_refund event
58
+ * Creates a refund based on the created creditmemo
59
+ * @param Varien_Event_Observer $observer
60
+ */
61
+ public function refundCreditmemo(Varien_Event_Observer $observer)
62
+ {
63
+ $creditmemo = $observer->getEvent()->getCreditmemo();
64
+ $order = $creditmemo->getOrder();
65
+ if ($order->getPayment()->getMethod() === 'paymill_creditcard' || $order->getPayment()->getMethod() === 'paymill_directdebit') {
66
+ $amount = (int) ((string) ($creditmemo->getGrandTotal() * 100));
67
+ Mage::helper('paymill/loggingHelper')->log("Trying to Refund.", var_export($order->getIncrementId(), true), $amount);
68
+ Mage::helper('paymill/refundHelper')->createRefund($order, $amount);
69
+ }
70
+ }
71
+
72
+ }
73
+
app/code/community/Paymill/Paymill/Model/TransactionData.php CHANGED
@@ -1,63 +1,63 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- class Paymill_Paymill_Model_TransactionData
22
- {
23
-
24
- private $_preAuthorizationFlag = null;
25
- private $_transactionId = null;
26
-
27
- /**
28
- * Returns the state of the PreAuthorizationFlag
29
- * @return Boolean
30
- */
31
- public function getPreAuthorizationFlag()
32
- {
33
- return $this->_preAuthorizationFlag;
34
- }
35
-
36
- /**
37
- * Returns the TransactionId as a string
38
- * @return String
39
- */
40
- public function getTransactionId()
41
- {
42
- return $this->_transactionId;
43
- }
44
-
45
- /**
46
- * Sets the PreAuthorizationFlag
47
- * @param Boolean $flag
48
- */
49
- public function setPreAuthorizationFlag($flag)
50
- {
51
- $this->_preAuthorizationFlag = $flag;
52
- }
53
-
54
- /**
55
- * Sets the transaction id
56
- * @param String $id
57
- */
58
- public function setTransactionId($id)
59
- {
60
- $this->_transactionId = $id;
61
- }
62
-
63
  }
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Paymill_Paymill_Model_TransactionData
22
+ {
23
+
24
+ private $_preAuthorizationFlag = null;
25
+ private $_transactionId = null;
26
+
27
+ /**
28
+ * Returns the state of the PreAuthorizationFlag
29
+ * @return Boolean
30
+ */
31
+ public function getPreAuthorizationFlag()
32
+ {
33
+ return $this->_preAuthorizationFlag;
34
+ }
35
+
36
+ /**
37
+ * Returns the TransactionId as a string
38
+ * @return String
39
+ */
40
+ public function getTransactionId()
41
+ {
42
+ return $this->_transactionId;
43
+ }
44
+
45
+ /**
46
+ * Sets the PreAuthorizationFlag
47
+ * @param Boolean $flag
48
+ */
49
+ public function setPreAuthorizationFlag($flag)
50
+ {
51
+ $this->_preAuthorizationFlag = $flag;
52
+ }
53
+
54
+ /**
55
+ * Sets the transaction id
56
+ * @param String $id
57
+ */
58
+ public function setTransactionId($id)
59
+ {
60
+ $this->_transactionId = $id;
61
+ }
62
+
63
  }
app/code/community/Paymill/Paymill/controllers/Adminhtml/LogController.php CHANGED
@@ -1,67 +1,67 @@
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
- * @category Paymill * @package Paymill_Paymill
17
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
- */
20
- class Paymill_Paymill_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action
21
- {
22
-
23
- /**
24
- * Initialize logs view
25
- *
26
- * @return Paymill_Paymill_Adminhtml_LogController
27
- */
28
- protected function _initAction()
29
- {
30
- $this->loadLayout()->_setActiveMenu('log/paymill_log');
31
- return $this;
32
- }
33
-
34
- /**
35
- * Action initially called
36
- */
37
- public function indexAction()
38
- {
39
- // Let's call our initAction method which will set some basic params for each action
40
- $this->_initAction()
41
- ->renderLayout();
42
- }
43
-
44
- /**
45
- * Normal Magento delete mass action for selected entries
46
- */
47
- public function massDeleteAction()
48
- {
49
- $logIds = $this->getRequest()->getParam('log_id');
50
-
51
- if (!is_array($logIds)) {
52
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('paymill')->__('paymill_error_text_no_entry_selected'));
53
- } else {
54
- try {
55
- foreach ($logIds as $logId) {
56
- Mage::getModel('paymill/log')->load($logId)->delete();
57
- }
58
-
59
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('paymill')->__("paymill_log_action_success"));
60
- } catch (Exception $e) {
61
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
62
- }
63
- }
64
- $this->_redirect('*/*/index');
65
- }
66
-
67
- }
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
+ * @category Paymill * @package Paymill_Paymill
17
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ class Paymill_Paymill_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action
21
+ {
22
+
23
+ /**
24
+ * Initialize logs view
25
+ *
26
+ * @return Paymill_Paymill_Adminhtml_LogController
27
+ */
28
+ protected function _initAction()
29
+ {
30
+ $this->loadLayout()->_setActiveMenu('log/paymill_log');
31
+ return $this;
32
+ }
33
+
34
+ /**
35
+ * Action initially called
36
+ */
37
+ public function indexAction()
38
+ {
39
+ // Let's call our initAction method which will set some basic params for each action
40
+ $this->_initAction()
41
+ ->renderLayout();
42
+ }
43
+
44
+ /**
45
+ * Normal Magento delete mass action for selected entries
46
+ */
47
+ public function massDeleteAction()
48
+ {
49
+ $logIds = $this->getRequest()->getParam('log_id');
50
+
51
+ if (!is_array($logIds)) {
52
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('paymill')->__('paymill_error_text_no_entry_selected'));
53
+ } else {
54
+ try {
55
+ foreach ($logIds as $logId) {
56
+ Mage::getModel('paymill/log')->load($logId)->delete();
57
+ }
58
+
59
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('paymill')->__("paymill_log_action_success"));
60
+ } catch (Exception $e) {
61
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
62
+ }
63
+ }
64
+ $this->_redirect('*/*/index');
65
+ }
66
+
67
+ }
app/code/community/Paymill/Paymill/etc/adminhtml.xml CHANGED
@@ -1,16 +1,16 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <menu>
4
- <logs>
5
- <title>Paymill</title>
6
- <sort_order>60</sort_order>
7
- <children>
8
- <paymill_log translate="title" module="paymill">
9
- <title>paymill_log</title>
10
- <sort_order>10</sort_order>
11
- <action>paymill/adminhtml_log</action>
12
- </paymill_log>
13
- </children>
14
- </logs>
15
- </menu>
16
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <logs>
5
+ <title>Paymill</title>
6
+ <sort_order>60</sort_order>
7
+ <children>
8
+ <paymill_log translate="title" module="paymill">
9
+ <title>paymill_log</title>
10
+ <sort_order>10</sort_order>
11
+ <action>paymill/adminhtml_log</action>
12
+ </paymill_log>
13
+ </children>
14
+ </logs>
15
+ </menu>
16
  </config>
app/code/community/Paymill/Paymill/etc/config.xml CHANGED
@@ -1,162 +1,162 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Paymill_Paymill>
5
- <version>3.0.6</version>
6
- </Paymill_Paymill>
7
- </modules>
8
-
9
-
10
- <global>
11
- <blocks>
12
- <paymill>
13
- <class>Paymill_Paymill_Block</class>
14
- </paymill>
15
- </blocks>
16
-
17
- <models>
18
- <paymill>
19
- <class>Paymill_Paymill_Model</class>
20
- <resourceModel>paymill_mysql4</resourceModel>
21
- </paymill>
22
- <paymill_mysql4>
23
- <class>Paymill_Paymill_Model_Mysql4</class>
24
- <entities>
25
- <log>
26
- <table>paymill_log</table>
27
- </log>
28
- <fastcheckout>
29
- <table>paymill_fastCheckout</table>
30
- </fastcheckout>
31
- </entities>
32
- </paymill_mysql4>
33
- </models>
34
-
35
- <helpers>
36
- <paymill>
37
- <class>Paymill_Paymill_Helper</class>
38
- </paymill>
39
- </helpers>
40
-
41
- <resources>
42
- <paymill_setup>
43
- <setup>
44
- <module>Paymill_Paymill</module>
45
- </setup>
46
- <connection>
47
- <use>core_setup</use>
48
- </connection>
49
- </paymill_setup>
50
-
51
- <paymill_write>
52
- <connection>
53
- <use>core_write</use>
54
- </connection>
55
- </paymill_write>
56
-
57
- <paymill_read>
58
- <connection>
59
- <use>core_read</use>
60
- </connection>
61
- </paymill_read>
62
- </resources>
63
- </global>
64
-
65
-
66
- <!-- declare default configuration values for this module -->
67
- <default>
68
- <!-- 'payment' configuration section (tab) -->
69
- <payment>
70
- <paymill_creditcard>
71
- <active>0</active>
72
- <currency>EUR,USD</currency>
73
- <model>paymill/method_methodModelCreditcard</model>
74
- <order_status>pending</order_status>
75
- <title>paymill_credit_card</title>
76
- <payment_action>authorize</payment_action>
77
- </paymill_creditcard>
78
-
79
- <paymill_directdebit>
80
- <active>0</active>
81
- <currency>EUR,USD</currency>
82
- <model>paymill/method_methodModelDirectdebit</model>
83
- <order_status>pending_payment</order_status>
84
- <title>paymill_direct_debit</title>
85
- <payment_action>authorize</payment_action>
86
- </paymill_directdebit>
87
- </payment>
88
- </default>
89
-
90
- <frontend>
91
- <layout>
92
- <updates>
93
- <paymill>
94
- <file>paymill.xml</file>
95
- </paymill>
96
- </updates>
97
- </layout>
98
- <translate>
99
- <modules>
100
- <Paymill_Paymill>
101
- <files>
102
- <default>Paymill_Paymill.csv</default>
103
- </files>
104
- </Paymill_Paymill>
105
- </modules>
106
- </translate>
107
- <events>
108
- <checkout_onepage_controller_success_action>
109
- <observers>
110
- <paymill_paymill_model_observer>
111
- <type>model</type>
112
- <class>Paymill_Paymill_Model_Observer</class>
113
- <method>generateInvoice</method>
114
- </paymill_paymill_model_observer>
115
- </observers>
116
- </checkout_onepage_controller_success_action>
117
- </events>
118
- </frontend>
119
-
120
- <adminhtml>
121
- <translate>
122
- <modules>
123
- <Paymill_Paymill>
124
- <files>
125
- <default>Paymill_Paymill.csv</default>
126
- </files>
127
- </Paymill_Paymill>
128
- </modules>
129
- </translate>
130
- <layout>
131
- <updates>
132
- <paymill>
133
- <file>paymill.xml</file>
134
- </paymill>
135
- </updates>
136
- </layout>
137
- <events>
138
- <sales_order_creditmemo_refund>
139
- <observers>
140
- <paymill_paymill_model_observer>
141
- <type>model</type>
142
- <class>Paymill_Paymill_Model_Observer</class>
143
- <method>refundCreditmemo</method>
144
- </paymill_paymill_model_observer>
145
- </observers>
146
- </sales_order_creditmemo_refund>
147
- </events>
148
- </adminhtml>
149
-
150
- <admin>
151
- <routers>
152
- <paymill>
153
- <use>admin</use>
154
- <args>
155
- <module>Paymill_Paymill</module>
156
- <frontName>paymill</frontName>
157
- </args>
158
- </paymill>
159
- </routers>
160
- </admin>
161
-
162
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Paymill_Paymill>
5
+ <version>3.1.0</version>
6
+ </Paymill_Paymill>
7
+ </modules>
8
+
9
+
10
+ <global>
11
+ <blocks>
12
+ <paymill>
13
+ <class>Paymill_Paymill_Block</class>
14
+ </paymill>
15
+ </blocks>
16
+
17
+ <models>
18
+ <paymill>
19
+ <class>Paymill_Paymill_Model</class>
20
+ <resourceModel>paymill_mysql4</resourceModel>
21
+ </paymill>
22
+ <paymill_mysql4>
23
+ <class>Paymill_Paymill_Model_Mysql4</class>
24
+ <entities>
25
+ <log>
26
+ <table>paymill_log</table>
27
+ </log>
28
+ <fastcheckout>
29
+ <table>paymill_fastCheckout</table>
30
+ </fastcheckout>
31
+ </entities>
32
+ </paymill_mysql4>
33
+ </models>
34
+
35
+ <helpers>
36
+ <paymill>
37
+ <class>Paymill_Paymill_Helper</class>
38
+ </paymill>
39
+ </helpers>
40
+
41
+ <resources>
42
+ <paymill_setup>
43
+ <setup>
44
+ <module>Paymill_Paymill</module>
45
+ </setup>
46
+ <connection>
47
+ <use>core_setup</use>
48
+ </connection>
49
+ </paymill_setup>
50
+
51
+ <paymill_write>
52
+ <connection>
53
+ <use>core_write</use>
54
+ </connection>
55
+ </paymill_write>
56
+
57
+ <paymill_read>
58
+ <connection>
59
+ <use>core_read</use>
60
+ </connection>
61
+ </paymill_read>
62
+ </resources>
63
+ </global>
64
+
65
+
66
+ <!-- declare default configuration values for this module -->
67
+ <default>
68
+ <!-- 'payment' configuration section (tab) -->
69
+ <payment>
70
+ <paymill_creditcard>
71
+ <active>0</active>
72
+ <currency>EUR,USD</currency>
73
+ <model>paymill/method_methodModelCreditcard</model>
74
+ <order_status>pending</order_status>
75
+ <title>paymill_credit_card</title>
76
+ <payment_action>authorize</payment_action>
77
+ </paymill_creditcard>
78
+
79
+ <paymill_directdebit>
80
+ <active>0</active>
81
+ <currency>EUR,USD</currency>
82
+ <model>paymill/method_methodModelDirectdebit</model>
83
+ <order_status>pending_payment</order_status>
84
+ <title>paymill_direct_debit</title>
85
+ <payment_action>authorize</payment_action>
86
+ </paymill_directdebit>
87
+ </payment>
88
+ </default>
89
+
90
+ <frontend>
91
+ <layout>
92
+ <updates>
93
+ <paymill>
94
+ <file>paymill.xml</file>
95
+ </paymill>
96
+ </updates>
97
+ </layout>
98
+ <translate>
99
+ <modules>
100
+ <Paymill_Paymill>
101
+ <files>
102
+ <default>Paymill_Paymill.csv</default>
103
+ </files>
104
+ </Paymill_Paymill>
105
+ </modules>
106
+ </translate>
107
+ <events>
108
+ <checkout_onepage_controller_success_action>
109
+ <observers>
110
+ <paymill_paymill_model_observer>
111
+ <type>model</type>
112
+ <class>Paymill_Paymill_Model_Observer</class>
113
+ <method>generateInvoice</method>
114
+ </paymill_paymill_model_observer>
115
+ </observers>
116
+ </checkout_onepage_controller_success_action>
117
+ </events>
118
+ </frontend>
119
+
120
+ <adminhtml>
121
+ <translate>
122
+ <modules>
123
+ <Paymill_Paymill>
124
+ <files>
125
+ <default>Paymill_Paymill.csv</default>
126
+ </files>
127
+ </Paymill_Paymill>
128
+ </modules>
129
+ </translate>
130
+ <layout>
131
+ <updates>
132
+ <paymill>
133
+ <file>paymill.xml</file>
134
+ </paymill>
135
+ </updates>
136
+ </layout>
137
+ <events>
138
+ <sales_order_creditmemo_refund>
139
+ <observers>
140
+ <paymill_paymill_model_observer>
141
+ <type>model</type>
142
+ <class>Paymill_Paymill_Model_Observer</class>
143
+ <method>refundCreditmemo</method>
144
+ </paymill_paymill_model_observer>
145
+ </observers>
146
+ </sales_order_creditmemo_refund>
147
+ </events>
148
+ </adminhtml>
149
+
150
+ <admin>
151
+ <routers>
152
+ <paymill>
153
+ <use>admin</use>
154
+ <args>
155
+ <module>Paymill_Paymill</module>
156
+ <frontName>paymill</frontName>
157
+ </args>
158
+ </paymill>
159
+ </routers>
160
+ </admin>
161
+
162
  </config>
app/code/community/Paymill/Paymill/etc/system.xml CHANGED
@@ -1,244 +1,244 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <sections>
4
- <payment>
5
- <groups>
6
- <paymill translate="label">
7
- <label>paymill_Basic_Setting</label>
8
- <show_in_default>1</show_in_default>
9
- <show_in_website>1</show_in_website>
10
- <show_in_store>1</show_in_store>
11
- <sort_order>700</sort_order>
12
- <fields>
13
- <version>
14
- <label>v3.0.5</label>
15
- <sort_order>1</sort_order>
16
- <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
17
- <frontend_type>label</frontend_type>
18
- <show_in_default>1</show_in_default>
19
- <show_in_website>1</show_in_website>
20
- <show_in_store>1</show_in_store>
21
- </version>
22
- <public_key translate="label, tooltip, comment">
23
- <label>paymill_Public_Key</label>
24
- <sort_order>2</sort_order>
25
- <tooltip>paymill_public_key_tooltip</tooltip>
26
- <comment>paymill_public_key_comment</comment>
27
- <frontend_type>text</frontend_type>
28
- <show_in_default>1</show_in_default>
29
- <show_in_website>1</show_in_website>
30
- <show_in_store>1</show_in_store>
31
- </public_key>
32
- <private_key translate="label, tooltip, comment">
33
- <label>paymill_Private_Key</label>
34
- <sort_order>3</sort_order>
35
- <tooltip>paymill_private_key_tooltip</tooltip>
36
- <comment>paymill_private_key_comment</comment>
37
- <frontend_type>text</frontend_type>
38
- <show_in_default>1</show_in_default>
39
- <show_in_website>1</show_in_website>
40
- <show_in_store>1</show_in_store>
41
- </private_key>
42
- <debugging_active translate="label">
43
- <label>paymill_Activate_Debugging</label>
44
- <sort_order>6</sort_order>
45
- <frontend_type>select</frontend_type>
46
- <source_model>adminhtml/system_config_source_yesno</source_model>
47
- <show_in_default>1</show_in_default>
48
- <show_in_website>1</show_in_website>
49
- <show_in_store>1</show_in_store>
50
- </debugging_active>
51
- <fc_active translate="label">
52
- <label>paymill_fc_active</label>
53
- <sort_order>7</sort_order>
54
- <frontend_type>select</frontend_type>
55
- <source_model>adminhtml/system_config_source_yesno</source_model>
56
- <show_in_default>1</show_in_default>
57
- <show_in_website>1</show_in_website>
58
- <show_in_store>1</show_in_store>
59
- </fc_active>
60
- <logging_active translate="label">
61
- <label>paymill_Activate_Logging</label>
62
- <sort_order>8</sort_order>
63
- <frontend_type>select</frontend_type>
64
- <source_model>adminhtml/system_config_source_yesno</source_model>
65
- <show_in_default>1</show_in_default>
66
- <show_in_website>1</show_in_website>
67
- <show_in_store>1</show_in_store>
68
- </logging_active>
69
- <show_label translate="label">
70
- <label>paymill_Show_Label</label>
71
- <sort_order>9</sort_order>
72
- <frontend_type>select</frontend_type>
73
- <source_model>adminhtml/system_config_source_yesno</source_model>
74
- <show_in_default>1</show_in_default>
75
- <show_in_website>1</show_in_website>
76
- <show_in_store>1</show_in_store>
77
- </show_label>
78
- <preAuth_active translate="label">
79
- <label>paymill_preAuth_active</label>
80
- <sort_order>10</sort_order>
81
- <frontend_type>select</frontend_type>
82
- <source_model>adminhtml/system_config_source_yesno</source_model>
83
- <show_in_default>1</show_in_default>
84
- <show_in_website>1</show_in_website>
85
- <show_in_store>1</show_in_store>
86
- </preAuth_active>
87
- </fields>
88
- </paymill>
89
-
90
- <paymill_creditcard module="paymill" translate="label">
91
- <label>paymill_credit_card_label</label>
92
- <show_in_default>1</show_in_default>
93
- <show_in_website>1</show_in_website>
94
- <show_in_store>1</show_in_store>
95
- <sort_order>800</sort_order>
96
- <fields>
97
- <version>
98
- <label>v3.0.5</label>
99
- <sort_order>100</sort_order>
100
- <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
101
- <frontend_type>label</frontend_type>
102
- <show_in_default>1</show_in_default>
103
- <show_in_website>1</show_in_website>
104
- <show_in_store>1</show_in_store>
105
- </version>
106
-
107
- <active translate="label">
108
- <label>paymill_opt_Enabled</label>
109
- <sort_order>200</sort_order>
110
- <frontend_type>select</frontend_type>
111
- <source_model>adminhtml/system_config_source_yesno</source_model>
112
- <show_in_default>1</show_in_default>
113
- <show_in_website>1</show_in_website>
114
- <show_in_store>1</show_in_store>
115
- </active>
116
-
117
- <tokenTolerance translate="label, tooltip, comment">
118
- <label>paymill_token_tolerace</label>
119
- <sort_order>210</sort_order>
120
- <tooltip>paymill_token_tolerace_tooltip</tooltip>
121
- <comment>paymill_token_tolerace_comment</comment>
122
- <frontend_type>text</frontend_type>
123
- <show_in_default>1</show_in_default>
124
- <show_in_website>1</show_in_website>
125
- <show_in_store>1</show_in_store>
126
- </tokenTolerance>
127
- <allowspecific translate="label">
128
- <label>Payment from Applicable Countries</label>
129
- <sort_order>220</sort_order>
130
- <frontend_type>allowspecific</frontend_type>
131
- <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
132
- <show_in_default>1</show_in_default>
133
- <show_in_website>1</show_in_website>
134
- <show_in_store>1</show_in_store>
135
- </allowspecific>
136
- <specificcountry translate="label">
137
- <label>Payment from Specific Countries</label>
138
- <sort_order>300</sort_order>
139
- <frontend_type>multiselect</frontend_type>
140
- <source_model>adminhtml/system_config_source_country</source_model>
141
- <can_be_empty>1</can_be_empty>
142
- <show_in_default>1</show_in_default>
143
- <show_in_website>1</show_in_website>
144
- <show_in_store>1</show_in_store>
145
- </specificcountry>
146
- <currency translate="label">
147
- <label>paymill_accepted_currency</label>
148
- <frontend_type>multiselect</frontend_type>
149
- <source_model>adminhtml/system_config_source_currency</source_model>
150
- <sort_order>350</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
- </currency>
155
- <sort_order translate="label">
156
- <label>paymill_opt_Sort</label>
157
- <frontend_type>text</frontend_type>
158
- <sort_order>400</sort_order>
159
- <show_in_default>1</show_in_default>
160
- <show_in_website>1</show_in_website>
161
- <show_in_store>1</show_in_store>
162
- </sort_order>
163
- </fields>
164
- </paymill_creditcard>
165
-
166
- <paymill_directdebit module="paymill" translate="label">
167
- <label>paymill_direct_debit_label</label>
168
- <show_in_default>1</show_in_default>
169
- <show_in_website>1</show_in_website>
170
- <show_in_store>1</show_in_store>
171
- <sort_order>800</sort_order>
172
- <fields>
173
- <version>
174
- <label>v3.0.5</label>
175
- <sort_order>100</sort_order>
176
- <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
177
- <frontend_type>label</frontend_type>
178
- <show_in_default>1</show_in_default>
179
- <show_in_website>1</show_in_website>
180
- <show_in_store>1</show_in_store>
181
- </version>
182
-
183
- <active translate="label">
184
- <label>paymill_opt_Enabled</label>
185
- <sort_order>200</sort_order>
186
- <frontend_type>select</frontend_type>
187
- <source_model>adminhtml/system_config_source_yesno</source_model>
188
- <show_in_default>1</show_in_default>
189
- <show_in_website>1</show_in_website>
190
- <show_in_store>1</show_in_store>
191
- </active>
192
-
193
- <tokenTolerance translate="label, tooltip, comment">
194
- <label>paymill_token_tolerace</label>
195
- <sort_order>210</sort_order>
196
- <tooltip>paymill_token_tolerace_tooltip</tooltip>
197
- <comment>paymill_token_tolerace_comment</comment>
198
- <frontend_type>text</frontend_type>
199
- <show_in_default>1</show_in_default>
200
- <show_in_website>1</show_in_website>
201
- <show_in_store>1</show_in_store>
202
- </tokenTolerance>
203
- <allowspecific translate="label">
204
- <label>Payment from Applicable Countries</label>
205
- <sort_order>220</sort_order>
206
- <frontend_type>allowspecific</frontend_type>
207
- <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
208
- <show_in_default>1</show_in_default>
209
- <show_in_website>1</show_in_website>
210
- <show_in_store>1</show_in_store>
211
- </allowspecific>
212
- <specificcountry translate="label">
213
- <label>Payment from Specific Countries</label>
214
- <sort_order>300</sort_order>
215
- <frontend_type>multiselect</frontend_type>
216
- <source_model>adminhtml/system_config_source_country</source_model>
217
- <can_be_empty>1</can_be_empty>
218
- <show_in_default>1</show_in_default>
219
- <show_in_website>1</show_in_website>
220
- <show_in_store>1</show_in_store>
221
- </specificcountry>
222
- <currency translate="label">
223
- <label>paymill_accepted_currency</label>
224
- <frontend_type>multiselect</frontend_type>
225
- <source_model>adminhtml/system_config_source_currency</source_model>
226
- <sort_order>350</sort_order>
227
- <show_in_default>1</show_in_default>
228
- <show_in_website>1</show_in_website>
229
- <show_in_store>0</show_in_store>
230
- </currency>
231
- <sort_order translate="label">
232
- <label>paymill_opt_Sort</label>
233
- <frontend_type>text</frontend_type>
234
- <sort_order>400</sort_order>
235
- <show_in_default>1</show_in_default>
236
- <show_in_website>1</show_in_website>
237
- <show_in_store>1</show_in_store>
238
- </sort_order>
239
- </fields>
240
- </paymill_directdebit>
241
- </groups>
242
- </payment>
243
- </sections>
244
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <paymill translate="label">
7
+ <label>paymill_Basic_Setting</label>
8
+ <show_in_default>1</show_in_default>
9
+ <show_in_website>1</show_in_website>
10
+ <show_in_store>1</show_in_store>
11
+ <sort_order>700</sort_order>
12
+ <fields>
13
+ <version>
14
+ <label>v3.1.0</label>
15
+ <sort_order>1</sort_order>
16
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
17
+ <frontend_type>label</frontend_type>
18
+ <show_in_default>1</show_in_default>
19
+ <show_in_website>1</show_in_website>
20
+ <show_in_store>1</show_in_store>
21
+ </version>
22
+ <public_key translate="label, tooltip, comment">
23
+ <label>paymill_Public_Key</label>
24
+ <sort_order>2</sort_order>
25
+ <tooltip>paymill_public_key_tooltip</tooltip>
26
+ <comment>paymill_public_key_comment</comment>
27
+ <frontend_type>text</frontend_type>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ </public_key>
32
+ <private_key translate="label, tooltip, comment">
33
+ <label>paymill_Private_Key</label>
34
+ <sort_order>3</sort_order>
35
+ <tooltip>paymill_private_key_tooltip</tooltip>
36
+ <comment>paymill_private_key_comment</comment>
37
+ <frontend_type>text</frontend_type>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>1</show_in_store>
41
+ </private_key>
42
+ <debugging_active translate="label">
43
+ <label>paymill_Activate_Debugging</label>
44
+ <sort_order>6</sort_order>
45
+ <frontend_type>select</frontend_type>
46
+ <source_model>adminhtml/system_config_source_yesno</source_model>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ </debugging_active>
51
+ <fc_active translate="label">
52
+ <label>paymill_fc_active</label>
53
+ <sort_order>7</sort_order>
54
+ <frontend_type>select</frontend_type>
55
+ <source_model>adminhtml/system_config_source_yesno</source_model>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>1</show_in_store>
59
+ </fc_active>
60
+ <logging_active translate="label">
61
+ <label>paymill_Activate_Logging</label>
62
+ <sort_order>8</sort_order>
63
+ <frontend_type>select</frontend_type>
64
+ <source_model>adminhtml/system_config_source_yesno</source_model>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>1</show_in_store>
68
+ </logging_active>
69
+ <show_label translate="label">
70
+ <label>paymill_Show_Label</label>
71
+ <sort_order>9</sort_order>
72
+ <frontend_type>select</frontend_type>
73
+ <source_model>adminhtml/system_config_source_yesno</source_model>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ </show_label>
78
+ <preAuth_active translate="label">
79
+ <label>paymill_preAuth_active</label>
80
+ <sort_order>10</sort_order>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>adminhtml/system_config_source_yesno</source_model>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ </preAuth_active>
87
+ </fields>
88
+ </paymill>
89
+
90
+ <paymill_creditcard module="paymill" translate="label">
91
+ <label>paymill_credit_card_label</label>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ <sort_order>800</sort_order>
96
+ <fields>
97
+ <version>
98
+ <label>v3.1.0</label>
99
+ <sort_order>100</sort_order>
100
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
101
+ <frontend_type>label</frontend_type>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>1</show_in_store>
105
+ </version>
106
+
107
+ <active translate="label">
108
+ <label>paymill_opt_Enabled</label>
109
+ <sort_order>200</sort_order>
110
+ <frontend_type>select</frontend_type>
111
+ <source_model>adminhtml/system_config_source_yesno</source_model>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ </active>
116
+
117
+ <tokenTolerance translate="label, tooltip, comment">
118
+ <label>paymill_token_tolerace</label>
119
+ <sort_order>210</sort_order>
120
+ <tooltip>paymill_token_tolerace_tooltip</tooltip>
121
+ <comment>paymill_token_tolerace_comment</comment>
122
+ <frontend_type>text</frontend_type>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>1</show_in_store>
126
+ </tokenTolerance>
127
+ <allowspecific translate="label">
128
+ <label>Payment from Applicable Countries</label>
129
+ <sort_order>220</sort_order>
130
+ <frontend_type>allowspecific</frontend_type>
131
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
132
+ <show_in_default>1</show_in_default>
133
+ <show_in_website>1</show_in_website>
134
+ <show_in_store>1</show_in_store>
135
+ </allowspecific>
136
+ <specificcountry translate="label">
137
+ <label>Payment from Specific Countries</label>
138
+ <sort_order>300</sort_order>
139
+ <frontend_type>multiselect</frontend_type>
140
+ <source_model>adminhtml/system_config_source_country</source_model>
141
+ <can_be_empty>1</can_be_empty>
142
+ <show_in_default>1</show_in_default>
143
+ <show_in_website>1</show_in_website>
144
+ <show_in_store>1</show_in_store>
145
+ </specificcountry>
146
+ <currency translate="label">
147
+ <label>paymill_accepted_currency</label>
148
+ <frontend_type>multiselect</frontend_type>
149
+ <source_model>adminhtml/system_config_source_currency</source_model>
150
+ <sort_order>350</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
+ </currency>
155
+ <sort_order translate="label">
156
+ <label>paymill_opt_Sort</label>
157
+ <frontend_type>text</frontend_type>
158
+ <sort_order>400</sort_order>
159
+ <show_in_default>1</show_in_default>
160
+ <show_in_website>1</show_in_website>
161
+ <show_in_store>1</show_in_store>
162
+ </sort_order>
163
+ </fields>
164
+ </paymill_creditcard>
165
+
166
+ <paymill_directdebit module="paymill" translate="label">
167
+ <label>paymill_direct_debit_label</label>
168
+ <show_in_default>1</show_in_default>
169
+ <show_in_website>1</show_in_website>
170
+ <show_in_store>1</show_in_store>
171
+ <sort_order>800</sort_order>
172
+ <fields>
173
+ <version>
174
+ <label>v3.1.0</label>
175
+ <sort_order>100</sort_order>
176
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
177
+ <frontend_type>label</frontend_type>
178
+ <show_in_default>1</show_in_default>
179
+ <show_in_website>1</show_in_website>
180
+ <show_in_store>1</show_in_store>
181
+ </version>
182
+
183
+ <active translate="label">
184
+ <label>paymill_opt_Enabled</label>
185
+ <sort_order>200</sort_order>
186
+ <frontend_type>select</frontend_type>
187
+ <source_model>adminhtml/system_config_source_yesno</source_model>
188
+ <show_in_default>1</show_in_default>
189
+ <show_in_website>1</show_in_website>
190
+ <show_in_store>1</show_in_store>
191
+ </active>
192
+
193
+ <tokenTolerance translate="label, tooltip, comment">
194
+ <label>paymill_token_tolerace</label>
195
+ <sort_order>210</sort_order>
196
+ <tooltip>paymill_token_tolerace_tooltip</tooltip>
197
+ <comment>paymill_token_tolerace_comment</comment>
198
+ <frontend_type>text</frontend_type>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>1</show_in_website>
201
+ <show_in_store>1</show_in_store>
202
+ </tokenTolerance>
203
+ <allowspecific translate="label">
204
+ <label>Payment from Applicable Countries</label>
205
+ <sort_order>220</sort_order>
206
+ <frontend_type>allowspecific</frontend_type>
207
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>1</show_in_website>
210
+ <show_in_store>1</show_in_store>
211
+ </allowspecific>
212
+ <specificcountry translate="label">
213
+ <label>Payment from Specific Countries</label>
214
+ <sort_order>300</sort_order>
215
+ <frontend_type>multiselect</frontend_type>
216
+ <source_model>adminhtml/system_config_source_country</source_model>
217
+ <can_be_empty>1</can_be_empty>
218
+ <show_in_default>1</show_in_default>
219
+ <show_in_website>1</show_in_website>
220
+ <show_in_store>1</show_in_store>
221
+ </specificcountry>
222
+ <currency translate="label">
223
+ <label>paymill_accepted_currency</label>
224
+ <frontend_type>multiselect</frontend_type>
225
+ <source_model>adminhtml/system_config_source_currency</source_model>
226
+ <sort_order>350</sort_order>
227
+ <show_in_default>1</show_in_default>
228
+ <show_in_website>1</show_in_website>
229
+ <show_in_store>0</show_in_store>
230
+ </currency>
231
+ <sort_order translate="label">
232
+ <label>paymill_opt_Sort</label>
233
+ <frontend_type>text</frontend_type>
234
+ <sort_order>400</sort_order>
235
+ <show_in_default>1</show_in_default>
236
+ <show_in_website>1</show_in_website>
237
+ <show_in_store>1</show_in_store>
238
+ </sort_order>
239
+ </fields>
240
+ </paymill_directdebit>
241
+ </groups>
242
+ </payment>
243
+ </sections>
244
  </config>
app/code/community/Paymill/Paymill/sql/paymill_setup/mysql4-install-3.0.0.php CHANGED
@@ -1,46 +1,46 @@
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
- * @category Paymill
17
- * @package Paymill_Paymill
18
- * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
- $installer = $this;
22
- $installer->startSetup();
23
-
24
- $installer->run("
25
- CREATE TABLE IF NOT EXISTS `{$this->getTable('paymill_log')}` (
26
- `id` int(11) NOT NULL AUTO_INCREMENT,
27
- `entry_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
28
- `version` varchar(25) NOT NULL COLLATE utf8_unicode_ci,
29
- `merchant_info` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
30
- `dev_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
31
- `dev_info_additional` text COLLATE utf8_unicode_ci DEFAULT NULL,
32
- PRIMARY KEY (`id`)
33
- ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
34
-
35
- CREATE TABLE IF NOT EXISTS `{$this->getTable('paymill_fastCheckout')}` (
36
- `id` int(11) NOT NULL AUTO_INCREMENT,
37
- `user_id` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
38
- `client_id` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
39
- `cc_payment_id` varchar(250) COLLATE utf8_unicode_ci NULL,
40
- `elv_payment_id` varchar(250) COLLATE utf8_unicode_ci NULL,
41
- PRIMARY KEY (`id`),
42
- UNIQUE KEY `userId` (`user_id`)
43
- ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
44
- ");
45
-
46
  $installer->endSetup();
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
+ * @category Paymill
17
+ * @package Paymill_Paymill
18
+ * @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ $installer = $this;
22
+ $installer->startSetup();
23
+
24
+ $installer->run("
25
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('paymill_log')}` (
26
+ `id` int(11) NOT NULL AUTO_INCREMENT,
27
+ `entry_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
28
+ `version` varchar(25) NOT NULL COLLATE utf8_unicode_ci,
29
+ `merchant_info` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
30
+ `dev_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
31
+ `dev_info_additional` text COLLATE utf8_unicode_ci DEFAULT NULL,
32
+ PRIMARY KEY (`id`)
33
+ ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
34
+
35
+ CREATE TABLE IF NOT EXISTS `{$this->getTable('paymill_fastCheckout')}` (
36
+ `id` int(11) NOT NULL AUTO_INCREMENT,
37
+ `user_id` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
38
+ `client_id` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
39
+ `cc_payment_id` varchar(250) COLLATE utf8_unicode_ci NULL,
40
+ `elv_payment_id` varchar(250) COLLATE utf8_unicode_ci NULL,
41
+ PRIMARY KEY (`id`),
42
+ UNIQUE KEY `userId` (`user_id`)
43
+ ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
44
+ ");
45
+
46
  $installer->endSetup();
app/design/adminhtml/base/default/layout/paymill.xml CHANGED
@@ -1,12 +1,12 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <layout version="0.1.0">
3
- <paymill_adminhtml_log_index>
4
- <reference name="content">
5
- <block type="paymill/adminhtml_log" name="adminhtml_log.grid.container" />
6
- </reference>
7
- </paymill_adminhtml_log_index>
8
- <paymill_adminhtml_log_grid>
9
- <update handle="formkey"/>
10
- <block type="paymill/adminhtml_log_grid" name="adminhtml_log.grid" output="toHtml" />
11
- </paymill_adminhtml_log_grid>
12
- </layout>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <paymill_adminhtml_log_index>
4
+ <reference name="content">
5
+ <block type="paymill/adminhtml_log" name="adminhtml_log.grid.container" />
6
+ </reference>
7
+ </paymill_adminhtml_log_index>
8
+ <paymill_adminhtml_log_grid>
9
+ <update handle="formkey"/>
10
+ <block type="paymill/adminhtml_log_grid" name="adminhtml_log.grid" output="toHtml" />
11
+ </paymill_adminhtml_log_grid>
12
+ </layout>
app/design/adminhtml/base/default/template/paymill/payment/info/creditcard.phtml CHANGED
@@ -1,14 +1,14 @@
1
- <?php if ($_specificInfo = $this->getSpecificInformation()): ?>
2
- <table
3
- <tr>
4
- <td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
5
- </tr>
6
- <tr>
7
- <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
8
- </tr>
9
- <tr>
10
- <td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
11
- </tr>
12
- </table>
13
- <?php endif; ?>
14
  <?php echo $this->getChildHtml() ?>
1
+ <?php if ($_specificInfo = $this->getSpecificInformation()): ?>
2
+ <table
3
+ <tr>
4
+ <td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
5
+ </tr>
6
+ <tr>
7
+ <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
8
+ </tr>
9
+ <tr>
10
+ <td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
11
+ </tr>
12
+ </table>
13
+ <?php endif; ?>
14
  <?php echo $this->getChildHtml() ?>
app/design/adminhtml/base/default/template/paymill/payment/info/directdebit.phtml CHANGED
@@ -1,14 +1,14 @@
1
- <?php if ($_specificInfo = $this->getSpecificInformation()): ?>
2
- <table
3
- <tr>
4
- <td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
5
- </tr>
6
- <tr>
7
- <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
8
- </tr>
9
- <tr>
10
- <td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
11
- </tr>
12
- </table>
13
- <?php endif; ?>
14
  <?php echo $this->getChildHtml() ?>
1
+ <?php if ($_specificInfo = $this->getSpecificInformation()): ?>
2
+ <table
3
+ <tr>
4
+ <td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
5
+ </tr>
6
+ <tr>
7
+ <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
8
+ </tr>
9
+ <tr>
10
+ <td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
11
+ </tr>
12
+ </table>
13
+ <?php endif; ?>
14
  <?php echo $this->getChildHtml() ?>
app/design/frontend/base/default/template/paymill/payment/form/creditcard.phtml CHANGED
@@ -1,64 +1,65 @@
1
- <?php $_code = $this->getMethodCode() ?>
2
- <script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath() . "paymentForm.js" ?>"></script>
3
- <?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code) ?>
4
- <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
5
- <li>
6
- <label for="<?php echo $_code ?>_holdername" class="required"><em>*</em><?php echo $this->__("paymill_Holder") ?></label>
7
- <div class="input-box">
8
- <input value="" type="text" id="<?php echo $_code ?>_holdername" class="input-text paymill-validate-cc-holder required-entry"/>
9
- </div>
10
- </li>
11
- <li>
12
- <label for="<?php echo $_code ?>_number" class="required"><em>*</em><?php echo $this->__("paymill_Number") ?></label>
13
- <div class="input-box">
14
- <table>
15
- <tr>
16
- <td><input value="" type="text" id="<?php echo $_code ?>_number" class="input-text paymill-validate-cc-number required-entry"/></td>
17
- <td><div id="<?php echo $_code ?>_card_icon"></div></td>
18
- </tr>
19
- </table>
20
- </div>
21
- </li>
22
- <li>
23
- <label for="<?php echo $_code ?>_cvc" class="required"><em>*</em><?php echo $this->__("paymill_Cvc") ?></label>
24
- <div class="input-box">
25
- <input value="" type="text" id="<?php echo $_code ?>_cvc" class="input-text paymill-validate-cc-cvc required-entry"/>
26
- </div>
27
- </li>
28
- <li>
29
- <label for="<?php echo $_code ?>_expiry_month" class="required"><em>*</em><?php echo $this->__("paymill_Date") ?></label>
30
- <div class="input-box">
31
- <div class="v-fix">
32
- <select id="<?php echo $_code ?>_expiry_month" class="month paymill-validate-cc-expdate">
33
- <?php foreach ($this->getPaymillCcMonths() as $k => $v): ?>
34
- <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
35
- <?php endforeach ?>
36
- </select>
37
- </div>
38
- <div class="v-fix">
39
- <select id="<?php echo $_code ?>_expiry_year" class="year">
40
- <?php foreach ($this->getPaymillCcYears() as $k => $v): ?>
41
- <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
42
- <?php endforeach ?>
43
- </select>
44
- </div>
45
- </div>
46
- </li>
47
- <?php if (Mage::helper('paymill/optionHelper')->isShowingLabels()) : ?>
48
- <li><div class='paymill_powered'><div class='paymill_credits'><?php echo $this->__("paymill_slogan"); ?><a href='http://www.paymill.de' target='_blank'>PAYMILL</a></div></div></li>
49
- <?php endif; ?>
50
- <li>
51
- <input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
52
- <input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getPreAuthAmount($_code) ?>"/>
53
- <input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
54
- <input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
55
- <input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
56
- <input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
57
- <input class="paymill-info-fastCheckout-cc" name="payment[paymill-info-fastCheckout-cc]" id="payment[paymill-info-fastCheckout-cc]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
58
- <input class="paymill-payment-error-number" name="payment[paymill-payment-error-number]" id="payment[paymill-payment-error-number]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_cc") . "<br/>\n" ?>" />
59
- <input class="paymill-payment-error-holder" name="payment[paymill-payment-error-holder]" id="payment[paymill-payment-error-holder]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_cc") . "<br/>\n" ?>" />
60
- <input class="paymill-payment-error-expdate" name="payment[paymill-payment-error-expdate]" id="payment[paymill-payment-error-expdate]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_expdate") . "<br/>\n" ?>" />
61
- <input class="paymill-payment-error-cvc" name="payment[paymill-payment-error-cvc]" id="payment[paymill-payment-error--cvc]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_cvc") . "<br/>\n" ?>" />
62
- </li>
63
- </ul>
 
64
  </div>
1
+ <?php $_code = $this->getMethodCode() ?>
2
+ <script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath() . "paymentForm.js" ?>"></script>
3
+ <?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code) ?>
4
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
5
+ <li>
6
+ <label for="<?php echo $_code ?>_holdername" class="required"><em>*</em><?php echo $this->__("paymill_Holder") ?></label>
7
+ <div class="input-box">
8
+ <input value="" type="text" id="<?php echo $_code ?>_holdername" class="input-text paymill-validate-cc-holder required-entry"/>
9
+ </div>
10
+ </li>
11
+ <li>
12
+ <label for="<?php echo $_code ?>_number" class="required"><em>*</em><?php echo $this->__("paymill_Number") ?></label>
13
+ <div class="input-box">
14
+ <table>
15
+ <tr>
16
+ <td><input value="" type="text" id="<?php echo $_code ?>_number" class="input-text paymill-validate-cc-number required-entry"/></td>
17
+ <td><div id="<?php echo $_code ?>_card_icon"></div></td>
18
+ </tr>
19
+ </table>
20
+ </div>
21
+ </li>
22
+ <li>
23
+ <label for="<?php echo $_code ?>_cvc" class="required"><em>*</em><?php echo $this->__("paymill_Cvc") ?></label>
24
+ <div class="input-box">
25
+ <input value="" type="text" id="<?php echo $_code ?>_cvc" class="input-text paymill-validate-cc-cvc required-entry"/>
26
+ </div>
27
+ </li>
28
+ <li>
29
+ <label for="<?php echo $_code ?>_expiry_month" class="required"><em>*</em><?php echo $this->__("paymill_Date") ?></label>
30
+ <div class="input-box">
31
+ <div class="v-fix">
32
+ <select id="<?php echo $_code ?>_expiry_month" class="month paymill-validate-cc-expdate">
33
+ <?php foreach ($this->getPaymillCcMonths() as $k => $v): ?>
34
+ <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
35
+ <?php endforeach ?>
36
+ </select>
37
+ </div>
38
+ <div class="v-fix">
39
+ <select id="<?php echo $_code ?>_expiry_year" class="year">
40
+ <?php foreach ($this->getPaymillCcYears() as $k => $v): ?>
41
+ <option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
42
+ <?php endforeach ?>
43
+ </select>
44
+ </div>
45
+ </div>
46
+ </li>
47
+ <?php if (Mage::helper('paymill/optionHelper')->isShowingLabels()) : ?>
48
+ <li><div class='paymill_powered'><div class='paymill_credits'><?php echo $this->__("paymill_slogan"); ?><a href='http://www.paymill.de' target='_blank'>PAYMILL</a></div></div></li>
49
+ <?php endif; ?>
50
+ <li>
51
+ <input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
52
+ <input class="paymill_3ds_cancel" name="payment[paymill_3ds_cancel]" id="payment[paymill_3ds_cancel]" type="hidden" value="<?php echo $this->__("paymill_3ds_cancel") ?>" />
53
+ <input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getPreAuthAmount($_code) ?>"/>
54
+ <input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
55
+ <input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
56
+ <input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
57
+ <input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
58
+ <input class="paymill-info-fastCheckout-cc" name="payment[paymill-info-fastCheckout-cc]" id="payment[paymill-info-fastCheckout-cc]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
59
+ <input class="paymill-payment-error-number" name="payment[paymill-payment-error-number]" id="payment[paymill-payment-error-number]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_cc") . "<br/>\n" ?>" />
60
+ <input class="paymill-payment-error-holder" name="payment[paymill-payment-error-holder]" id="payment[paymill-payment-error-holder]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_cc") . "<br/>\n" ?>" />
61
+ <input class="paymill-payment-error-expdate" name="payment[paymill-payment-error-expdate]" id="payment[paymill-payment-error-expdate]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_expdate") . "<br/>\n" ?>" />
62
+ <input class="paymill-payment-error-cvc" name="payment[paymill-payment-error-cvc]" id="payment[paymill-payment-error--cvc]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_cvc") . "<br/>\n" ?>" />
63
+ </li>
64
+ </ul>
65
  </div>
app/design/frontend/base/default/template/paymill/payment/form/directdebit.phtml CHANGED
@@ -1,42 +1,42 @@
1
- <?php $_code = $this->getMethodCode() ?>
2
- <script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath() . "paymentForm.js" ?>"></script>
3
- <?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code) ?>
4
- <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
5
- <li>
6
- <p class="paymill-payment-errors alert-error" style="display:none;"></p>
7
- </li>
8
- <li>
9
- <label for="<?php echo $_code ?>_holdername" class="required"><em>*</em><?php echo $this->__("paymill_Holder") ?></label>
10
- <div class="input-box">
11
- <input value="" type="text" id="<?php echo $_code ?>_holdername" class="input-text paymill-validate-dd-holdername required-entry"/>
12
- </div>
13
- </li>
14
- <li>
15
- <label for="<?php echo $_code ?>_account" class="required"><em>*</em><?php echo $this->__("paymill_account") ?></label>
16
- <div class="input-box">
17
- <input value="" type="text" id="<?php echo $_code ?>_account" class="input-text paymill-validate-dd-account required-entry"/>
18
- </div>
19
- </li>
20
- <li>
21
- <label for="<?php echo $_code ?>_bankcode" class="required"><em>*</em><?php echo $this->__("paymill_bankcode") ?></label>
22
- <div class="input-box">
23
- <input value="" type="text" id="<?php echo $_code ?>_bankcode" class="input-text paymill-validate-dd-bankcode required-entry"/>
24
- </div>
25
- </li>
26
- <?php if (Mage::helper('paymill/optionHelper')->isShowingLabels()) : ?>
27
- <li><div class='paymill_powered'><div class='paymill_credits'> <?php echo $this->__("paymill_slogan_elv"); ?> <a href='http://www.paymill.de' target='_blank'>PAYMILL</a></div></div></li>
28
- <?php endif; ?>
29
- <li>
30
- <input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
31
- <input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getPreAuthAmount($_code) ?>" />
32
- <input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
33
- <input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
34
- <input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
35
- <input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
36
- <input class="paymill-info-fastCheckout-elv" name="payment[paymill-info-fastCheckout-elv]" id="payment[paymill-info-fastCheckout-elv]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
37
- <input class="paymill-payment-error-number-elv" name="payment[paymill-payment-error-number-elv]" id="payment[paymill-payment-error-number-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_elv") . "<br/>\n" ?>" />
38
- <input class="paymill-payment-error-holder-elv" name="payment[paymill-payment-error-holder-elv]" id="payment[paymill-payment-error-holder-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_elv") . "<br/>\n" ?>" />
39
- <input class="paymill-payment-error-bankcode" name="payment[paymill-payment-error-bankcode]" id="payment[paymill-payment-error-bankcode]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_bankcode") . "<br/>\n" ?>" />
40
- </li>
41
- </ul>
42
  </div>
1
+ <?php $_code = $this->getMethodCode() ?>
2
+ <script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath() . "paymentForm.js" ?>"></script>
3
+ <?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code) ?>
4
+ <ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
5
+ <li>
6
+ <p class="paymill-payment-errors alert-error" style="display:none;"></p>
7
+ </li>
8
+ <li>
9
+ <label for="<?php echo $_code ?>_holdername" class="required"><em>*</em><?php echo $this->__("paymill_Holder") ?></label>
10
+ <div class="input-box">
11
+ <input value="" type="text" id="<?php echo $_code ?>_holdername" class="input-text paymill-validate-dd-holdername required-entry"/>
12
+ </div>
13
+ </li>
14
+ <li>
15
+ <label for="<?php echo $_code ?>_account" class="required"><em>*</em><?php echo $this->__("paymill_account") ?></label>
16
+ <div class="input-box">
17
+ <input value="" type="text" id="<?php echo $_code ?>_account" class="input-text paymill-validate-dd-account required-entry"/>
18
+ </div>
19
+ </li>
20
+ <li>
21
+ <label for="<?php echo $_code ?>_bankcode" class="required"><em>*</em><?php echo $this->__("paymill_bankcode") ?></label>
22
+ <div class="input-box">
23
+ <input value="" type="text" id="<?php echo $_code ?>_bankcode" class="input-text paymill-validate-dd-bankcode required-entry"/>
24
+ </div>
25
+ </li>
26
+ <?php if (Mage::helper('paymill/optionHelper')->isShowingLabels()) : ?>
27
+ <li><div class='paymill_powered'><div class='paymill_credits'> <?php echo $this->__("paymill_slogan_elv"); ?> <a href='http://www.paymill.de' target='_blank'>PAYMILL</a></div></div></li>
28
+ <?php endif; ?>
29
+ <li>
30
+ <input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
31
+ <input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getPreAuthAmount($_code) ?>" />
32
+ <input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
33
+ <input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
34
+ <input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
35
+ <input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
36
+ <input class="paymill-info-fastCheckout-elv" name="payment[paymill-info-fastCheckout-elv]" id="payment[paymill-info-fastCheckout-elv]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
37
+ <input class="paymill-payment-error-number-elv" name="payment[paymill-payment-error-number-elv]" id="payment[paymill-payment-error-number-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_elv") . "<br/>\n" ?>" />
38
+ <input class="paymill-payment-error-holder-elv" name="payment[paymill-payment-error-holder-elv]" id="payment[paymill-payment-error-holder-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_elv") . "<br/>\n" ?>" />
39
+ <input class="paymill-payment-error-bankcode" name="payment[paymill-payment-error-bankcode]" id="payment[paymill-payment-error-bankcode]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_bankcode") . "<br/>\n" ?>" />
40
+ </li>
41
+ </ul>
42
  </div>
app/design/frontend/base/default/template/paymill/payment/info/creditcard.phtml CHANGED
@@ -1,6 +1,6 @@
1
- <table>
2
- <tr>
3
- <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
4
- </tr>
5
- </table>
6
  <?php echo $this->getChildHtml() ?>
1
+ <table>
2
+ <tr>
3
+ <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
4
+ </tr>
5
+ </table>
6
  <?php echo $this->getChildHtml() ?>
app/design/frontend/base/default/template/paymill/payment/info/directdebit.phtml CHANGED
@@ -1,6 +1,6 @@
1
- <table>
2
- <tr>
3
- <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
4
- </tr>
5
- </table>
6
  <?php echo $this->getChildHtml() ?>
1
+ <table>
2
+ <tr>
3
+ <td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
4
+ </tr>
5
+ </table>
6
  <?php echo $this->getChildHtml() ?>
app/etc/modules/Paymill_Paymill.xml CHANGED
@@ -1,16 +1,16 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <modules>
4
- <!-- declare CompanyName_NewModule module -->
5
- <Paymill_Paymill>
6
- <!-- this is an active module -->
7
- <active>true</active>
8
- <!-- this module will be located in app/code/local code pool -->
9
- <codePool>community</codePool>
10
- <!-- specify dependencies for correct module loading order -->
11
- <depends>
12
- <Mage_Payment />
13
- </depends>
14
- </Paymill_Paymill>
15
- </modules>
16
- </config>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <!-- declare CompanyName_NewModule module -->
5
+ <Paymill_Paymill>
6
+ <!-- this is an active module -->
7
+ <active>true</active>
8
+ <!-- this module will be located in app/code/local code pool -->
9
+ <codePool>community</codePool>
10
+ <!-- specify dependencies for correct module loading order -->
11
+ <depends>
12
+ <Mage_Payment />
13
+ </depends>
14
+ </Paymill_Paymill>
15
+ </modules>
16
+ </config>
app/locale/de_DE/Paymill_Paymill.csv CHANGED
@@ -1,55 +1,56 @@
1
- "paymill_credit_card","Kreditkarte"
2
- "paymill_direct_debit","Lastschrift"
3
- "paymill_creditcard","Kreditkarte"
4
- "paymill_directdebit","Lastschrift"
5
- "paymill_Basic_Setting","Paymill Grundeinstellungen"
6
- "paymill_Public_Key","Public Key"
7
- "paymill_Private_Key","Private Key"
8
- "paymill_Activate_Debugging","Debugging aktivieren"
9
- "paymill_fc_active","Fast Checkout erlauben"
10
- "paymill_Activate_Logging","Logging aktivieren"
11
- "paymill_Show_Label","Paymill Label im Checkout anzeigen"
12
- "paymill_credit_card_label","Paymill Kreditkarte"
13
- "paymill_direct_debit_label","Paymill Lastschrift"
14
- "paymill_opt_Enabled","Aktivieren"
15
- "paymill_opt_Countries","Länder"
16
- "paymill_opt_Sort","Reihenfolge"
17
- "paymill_Number","Nummer"
18
- "paymill_Cvc","CVC"
19
- "paymill_Holder","Inhabername"
20
- "paymill_Date","Gültig bis"
21
- "paymill_Amount","Betrag"
22
- "paymill_Currency","Währung"
23
- "paymill_public_key_tooltip","Bitte geben Sie hier Ihren Public Key ein."
24
- "paymill_public_key_comment","Ihren Public Key können Sie dem Paymill Cockpit entnehmen."
25
- "paymill_private_key_tooltip","Bitte geben Sie hier Ihren Private Key ein."
26
- "paymill_private_key_comment","Ihren Private Key können Sie dem Paymill Cockpit entnehmen."
27
- "paymill_error_text_invalid_number_cc","Bitte geben Sie eine gültige Kreditkartennummer ein."
28
- "paymill_error_text_invalid_number_elv","Bitte geben Sie eine gültige Kontonummer ein"
29
- "paymill_error_text_invalid_expdate","Ungültiges Ablaufdatum"
30
- "paymill_error_text_invalid_holder_cc","Bitte geben Sie einen Karteninhaber an."
31
- "paymill_error_text_invalid_holder_elv","Bitte geben Sie einen Kontoinhaber an."
32
- "paymill_error_text_invalid_bankcode","Ungültige Bankleitzahl"
33
- "paymill_error_text_invalid_payment","Zahlart konnte nicht identifiziert werden. Bitte kontaktieren Sie den Support."
34
- "paymill_account","Kontonummer"
35
- "paymill_bankcode","Bankleitzahl"
36
- "paymill_log","Paymill Log"
37
- "paymill_error_text_no_entry_selected","Bitte wählen Sie einen Eintrag aus"
38
- "paymill_action_delete", "Auswahl löschen"
39
- "paymill_dialog_confirm", "Sind Sie sicher?"
40
- "paymill_backend_log_id","ID"
41
- "paymill_backend_log_entry_date","Eintragsdatum"
42
- "paymill_backend_log_version","Version"
43
- "paymill_backend_log_merchant_info","Händler Informationen"
44
- "paymill_backend_log_dev_info","Entwickler Informationen"
45
- "paymill_backend_log_dev_info_additional","Weitere Entwickler Informationen"
46
- "paymill_checkout_generating_invoice","Rechnung wird generiert"
47
- "paymill_preAuth_active","Kreditkarten Transaktionen im Checkout authorisieren, Buchung bei Rechnungsgenerierung durchführen."
48
- "paymill_token_tolerace","Token Toleranz Wert"
49
- "paymill_token_tolerace_tooltip","Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
50
- "paymill_token_tolerace_comment", "Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
51
- "paymill_log_action_success", "Aktion erfolgreich"
52
- "paymill_accepted_currency", "Akzeptierte Währungen"
53
- "paymill_slogan","Sichere Kreditkartenzahlung powered by "
54
- "paymill_slogan_elv","Elektronisches Lastschriftverfahren powered by "
55
- "paymill_error_text_invalid_cvc", "Ungültige CVC"
 
1
+ "paymill_credit_card","Kreditkarte"
2
+ "paymill_direct_debit","Lastschrift"
3
+ "paymill_creditcard","Kreditkarte"
4
+ "paymill_directdebit","Lastschrift"
5
+ "paymill_Basic_Setting","Paymill Grundeinstellungen"
6
+ "paymill_Public_Key","Public Key"
7
+ "paymill_Private_Key","Private Key"
8
+ "paymill_Activate_Debugging","Debugging aktivieren"
9
+ "paymill_fc_active","Fast Checkout erlauben"
10
+ "paymill_Activate_Logging","Logging aktivieren"
11
+ "paymill_Show_Label","Paymill Label im Checkout anzeigen"
12
+ "paymill_credit_card_label","Paymill Kreditkarte"
13
+ "paymill_direct_debit_label","Paymill Lastschrift"
14
+ "paymill_opt_Enabled","Aktivieren"
15
+ "paymill_opt_Countries","Länder"
16
+ "paymill_opt_Sort","Reihenfolge"
17
+ "paymill_Number","Nummer"
18
+ "paymill_Cvc","CVC"
19
+ "paymill_Holder","Inhabername"
20
+ "paymill_Date","Gültig bis"
21
+ "paymill_Amount","Betrag"
22
+ "paymill_Currency","Währung"
23
+ "paymill_public_key_tooltip","Bitte geben Sie hier Ihren Public Key ein."
24
+ "paymill_public_key_comment","Ihren Public Key können Sie dem Paymill Cockpit entnehmen."
25
+ "paymill_private_key_tooltip","Bitte geben Sie hier Ihren Private Key ein."
26
+ "paymill_private_key_comment","Ihren Private Key können Sie dem Paymill Cockpit entnehmen."
27
+ "paymill_error_text_invalid_number_cc","Bitte geben Sie eine gültige Kreditkartennummer ein."
28
+ "paymill_error_text_invalid_number_elv","Bitte geben Sie eine gültige Kontonummer ein"
29
+ "paymill_error_text_invalid_expdate","Ungültiges Ablaufdatum"
30
+ "paymill_error_text_invalid_holder_cc","Bitte geben Sie einen Karteninhaber an."
31
+ "paymill_error_text_invalid_holder_elv","Bitte geben Sie einen Kontoinhaber an."
32
+ "paymill_error_text_invalid_bankcode","Ungültige Bankleitzahl"
33
+ "paymill_error_text_invalid_payment","Zahlart konnte nicht identifiziert werden. Bitte kontaktieren Sie den Support."
34
+ "paymill_account","Kontonummer"
35
+ "paymill_bankcode","Bankleitzahl"
36
+ "paymill_log","Paymill Log"
37
+ "paymill_error_text_no_entry_selected","Bitte wählen Sie einen Eintrag aus"
38
+ "paymill_action_delete", "Auswahl löschen"
39
+ "paymill_dialog_confirm", "Sind Sie sicher?"
40
+ "paymill_backend_log_id","ID"
41
+ "paymill_backend_log_entry_date","Eintragsdatum"
42
+ "paymill_backend_log_version","Version"
43
+ "paymill_backend_log_merchant_info","Händler Informationen"
44
+ "paymill_backend_log_dev_info","Entwickler Informationen"
45
+ "paymill_backend_log_dev_info_additional","Weitere Entwickler Informationen"
46
+ "paymill_checkout_generating_invoice","Rechnung wird generiert"
47
+ "paymill_preAuth_active","Kreditkarten Transaktionen im Checkout authorisieren, Buchung bei Rechnungsgenerierung durchführen."
48
+ "paymill_token_tolerace","Token Toleranz Wert"
49
+ "paymill_token_tolerace_tooltip","Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
50
+ "paymill_token_tolerace_comment", "Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
51
+ "paymill_log_action_success", "Aktion erfolgreich"
52
+ "paymill_accepted_currency", "Akzeptierte Währungen"
53
+ "paymill_slogan","Sichere Kreditkartenzahlung powered by "
54
+ "paymill_slogan_elv","Elektronisches Lastschriftverfahren powered by "
55
+ "paymill_error_text_invalid_cvc", "Ungültige CVC"
56
+ "paymill_3ds_cancel", "Abbrechen"
app/locale/en_GB/Paymill_Paymill.csv CHANGED
@@ -1,55 +1,56 @@
1
- "paymill_credit_card","Credit Card"
2
- "paymill_direct_debit","Direct Debit"
3
- "paymill_creditcard","Credit Card"
4
- "paymill_directdebit","Direct Debit"
5
- "paymill_Basic_Setting","Paymill Basic Settings"
6
- "paymill_Public_Key","Public Key"
7
- "paymill_Private_Key","Private Key"
8
- "paymill_Activate_Debugging","Activate Debugging"
9
- "paymill_fc_active","Enable Fast Checkout"
10
- "paymill_Activate_Logging","Enable Logging"
11
- "paymill_Show_Label","show Paymill label during checkout"
12
- "paymill_credit_card_label","Paymill Credit Card"
13
- "paymill_direct_debit_label","Paymill Direct Debit"
14
- "paymill_opt_Enabled","Enable"
15
- "paymill_opt_Countries","Countries"
16
- "paymill_opt_Sort","Sort Order"
17
- "paymill_Number","Number"
18
- "paymill_Cvc","CVC"
19
- "paymill_Holder","Accountowner"
20
- "paymill_Date","Valid until (MM/YYYY)"
21
- "paymill_Amount","Amount"
22
- "paymill_Currency","Currency"
23
- "paymill_public_key_tooltip","Please enter your Public Key."
24
- "paymill_public_key_comment","You can find your Public Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
25
- "paymill_private_key_tooltip","Please enter your Private Key."
26
- "paymill_private_key_comment","You can find your Private Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
27
- "paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
28
- "paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
29
- "paymill_error_text_invalid_expdate","Invalid Expiry Date"
30
- "paymill_error_text_invalid_holder_cc","Please enter a card holder."
31
- "paymill_error_text_invalid_holder_elv","Please enter an account holder."
32
- "paymill_error_text_invalid_bankcode","Invalid Bankcode"
33
- "paymill_error_text_invalid_payment","The payment you chose could not be identified. Please contact the support"
34
- "paymill_account","Accountnumber"
35
- "paymill_bankcode","Bankcode"
36
- "paymill_log","Paymill Log"
37
- "paymill_error_text_no_entry_selected","Please select an entry"
38
- "paymill_action_delete", "Delete selection"
39
- "paymill_dialog_confirm", "Are you sure?"
40
- "paymill_backend_log_id","ID"
41
- "paymill_backend_log_entry_date","Entry date"
42
- "paymill_backend_log_version","Version"
43
- "paymill_backend_log_merchant_info","Merchant Information"
44
- "paymill_backend_log_dev_info","Developer Information"
45
- "paymill_backend_log_dev_info_additional","Additional Developer Information"
46
- "paymill_checkout_generating_invoice","Invoice is beeing generated"
47
- "paymill_preAuth_active","Authorize Credit Card payments during Checkout and capture manually by generating the invoice."
48
- "paymill_token_tolerace","Token Tolerance Value"
49
- "paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
50
- "paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
51
- "paymill_log_action_success", "Action Successful"
52
- "paymill_accepted_currency", "Accepted Currencies"
53
- "paymill_slogan","Secure credit card payments powered by "
54
- "paymill_slogan_elv","Direct debit payments powered by "
55
- "paymill_error_text_invalid_cvc", "Invalid cvc"
 
1
+ "paymill_credit_card","Credit Card"
2
+ "paymill_direct_debit","Direct Debit"
3
+ "paymill_creditcard","Credit Card"
4
+ "paymill_directdebit","Direct Debit"
5
+ "paymill_Basic_Setting","Paymill Basic Settings"
6
+ "paymill_Public_Key","Public Key"
7
+ "paymill_Private_Key","Private Key"
8
+ "paymill_Activate_Debugging","Activate Debugging"
9
+ "paymill_fc_active","Enable Fast Checkout"
10
+ "paymill_Activate_Logging","Enable Logging"
11
+ "paymill_Show_Label","show Paymill label during checkout"
12
+ "paymill_credit_card_label","Paymill Credit Card"
13
+ "paymill_direct_debit_label","Paymill Direct Debit"
14
+ "paymill_opt_Enabled","Enable"
15
+ "paymill_opt_Countries","Countries"
16
+ "paymill_opt_Sort","Sort Order"
17
+ "paymill_Number","Number"
18
+ "paymill_Cvc","CVC"
19
+ "paymill_Holder","Accountowner"
20
+ "paymill_Date","Valid until (MM/YYYY)"
21
+ "paymill_Amount","Amount"
22
+ "paymill_Currency","Currency"
23
+ "paymill_public_key_tooltip","Please enter your Public Key."
24
+ "paymill_public_key_comment","You can find your Public Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
25
+ "paymill_private_key_tooltip","Please enter your Private Key."
26
+ "paymill_private_key_comment","You can find your Private Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
27
+ "paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
28
+ "paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
29
+ "paymill_error_text_invalid_expdate","Invalid Expiry Date"
30
+ "paymill_error_text_invalid_holder_cc","Please enter a card holder."
31
+ "paymill_error_text_invalid_holder_elv","Please enter an account holder."
32
+ "paymill_error_text_invalid_bankcode","Invalid Bankcode"
33
+ "paymill_error_text_invalid_payment","The payment you chose could not be identified. Please contact the support"
34
+ "paymill_account","Accountnumber"
35
+ "paymill_bankcode","Bankcode"
36
+ "paymill_log","Paymill Log"
37
+ "paymill_error_text_no_entry_selected","Please select an entry"
38
+ "paymill_action_delete", "Delete selection"
39
+ "paymill_dialog_confirm", "Are you sure?"
40
+ "paymill_backend_log_id","ID"
41
+ "paymill_backend_log_entry_date","Entry date"
42
+ "paymill_backend_log_version","Version"
43
+ "paymill_backend_log_merchant_info","Merchant Information"
44
+ "paymill_backend_log_dev_info","Developer Information"
45
+ "paymill_backend_log_dev_info_additional","Additional Developer Information"
46
+ "paymill_checkout_generating_invoice","Invoice is beeing generated"
47
+ "paymill_preAuth_active","Authorize Credit Card payments during Checkout and capture manually by generating the invoice."
48
+ "paymill_token_tolerace","Token Tolerance Value"
49
+ "paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
50
+ "paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
51
+ "paymill_log_action_success", "Action Successful"
52
+ "paymill_accepted_currency", "Accepted Currencies"
53
+ "paymill_slogan","Secure credit card payments powered by "
54
+ "paymill_slogan_elv","Direct debit payments powered by "
55
+ "paymill_error_text_invalid_cvc", "Invalid cvc"
56
+ "paymill_3ds_cancel", "cancel"
app/locale/en_US/Paymill_Paymill.csv CHANGED
@@ -1,55 +1,55 @@
1
- "paymill_credit_card","Credit Card"
2
- "paymill_direct_debit","Direct Debit"
3
- "paymill_creditcard","Credit Card"
4
- "paymill_directdebit","Direct Debit"
5
- "paymill_Basic_Setting","Paymill Basic Settings"
6
- "paymill_Public_Key","Public Key"
7
- "paymill_Private_Key","Private Key"
8
- "paymill_Activate_Debugging","Activate Debugging"
9
- "paymill_fc_active","Enable Fast Checkout"
10
- "paymill_Activate_Logging","Enable Logging"
11
- "paymill_Show_Label","show Paymill label during checkout"
12
- "paymill_credit_card_label","Paymill Credit Card"
13
- "paymill_direct_debit_label","Paymill Direct Debit"
14
- "paymill_opt_Enabled","Enable"
15
- "paymill_opt_Countries","Countries"
16
- "paymill_opt_Sort","Sort Order"
17
- "paymill_Number","Number"
18
- "paymill_Cvc","CVC"
19
- "paymill_Holder","Accountowner"
20
- "paymill_Date","Valid until (MM/YYYY)"
21
- "paymill_Amount","Amount"
22
- "paymill_Currency","Currency"
23
- "paymill_public_key_tooltip","Please enter your Public Key."
24
- "paymill_public_key_comment","You can find your Public Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
25
- "paymill_private_key_tooltip","Please enter your Private Key."
26
- "paymill_private_key_comment","You can find your Private Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
27
- "paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
28
- "paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
29
- "paymill_error_text_invalid_expdate","Invalid Expiry Date"
30
- "paymill_error_text_invalid_holder_cc","Please enter a card holder."
31
- "paymill_error_text_invalid_holder_elv","Please enter an account holder."
32
- "paymill_error_text_invalid_bankcode","Invalid Bankcode"
33
- "paymill_error_text_invalid_payment","The payment you chose could not be identified. Please contact the support"
34
- "paymill_account","Accountnumber"
35
- "paymill_bankcode","Bankcode"
36
- "paymill_log","Paymill Log"
37
- "paymill_error_text_no_entry_selected","Please select an entry"
38
- "paymill_action_delete", "Delete selection"
39
- "paymill_dialog_confirm", "Are you sure?"
40
- "paymill_backend_log_id","ID"
41
- "paymill_backend_log_entry_date","Entry date"
42
- "paymill_backend_log_version","Version"
43
- "paymill_backend_log_merchant_info","Merchant Information"
44
- "paymill_backend_log_dev_info","Developer Information"
45
- "paymill_backend_log_dev_info_additional","Additional Developer Information"
46
- "paymill_checkout_generating_invoice","Invoice is beeing generated"
47
- "paymill_preAuth_active","Authorize Credit Card payments during Checkout and capture manually by generating the invoice."
48
- "paymill_token_tolerace","Token Tolerance Value"
49
- "paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
50
- "paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
51
- "paymill_log_action_success", "Action Successful"
52
- "paymill_accepted_currency", "Accepted Currencies"
53
- "paymill_slogan","Secure credit card payments powered by "
54
- "paymill_slogan_elv","Direct debit payments powered by "
55
- "paymill_error_text_invalid_cvc", "Invalid cvc"
1
+ "paymill_credit_card","Credit Card"
2
+ "paymill_direct_debit","Direct Debit"
3
+ "paymill_creditcard","Credit Card"
4
+ "paymill_directdebit","Direct Debit"
5
+ "paymill_Basic_Setting","Paymill Basic Settings"
6
+ "paymill_Public_Key","Public Key"
7
+ "paymill_Private_Key","Private Key"
8
+ "paymill_Activate_Debugging","Activate Debugging"
9
+ "paymill_fc_active","Enable Fast Checkout"
10
+ "paymill_Activate_Logging","Enable Logging"
11
+ "paymill_Show_Label","show Paymill label during checkout"
12
+ "paymill_credit_card_label","Paymill Credit Card"
13
+ "paymill_direct_debit_label","Paymill Direct Debit"
14
+ "paymill_opt_Enabled","Enable"
15
+ "paymill_opt_Countries","Countries"
16
+ "paymill_opt_Sort","Sort Order"
17
+ "paymill_Number","Number"
18
+ "paymill_Cvc","CVC"
19
+ "paymill_Holder","Accountowner"
20
+ "paymill_Date","Valid until (MM/YYYY)"
21
+ "paymill_Amount","Amount"
22
+ "paymill_Currency","Currency"
23
+ "paymill_public_key_tooltip","Please enter your Public Key."
24
+ "paymill_public_key_comment","You can find your Public Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
25
+ "paymill_private_key_tooltip","Please enter your Private Key."
26
+ "paymill_private_key_comment","You can find your Private Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
27
+ "paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
28
+ "paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
29
+ "paymill_error_text_invalid_expdate","Invalid Expiry Date"
30
+ "paymill_error_text_invalid_holder_cc","Please enter a card holder."
31
+ "paymill_error_text_invalid_holder_elv","Please enter an account holder."
32
+ "paymill_error_text_invalid_bankcode","Invalid Bankcode"
33
+ "paymill_error_text_invalid_payment","The payment you chose could not be identified. Please contact the support"
34
+ "paymill_account","Accountnumber"
35
+ "paymill_bankcode","Bankcode"
36
+ "paymill_log","Paymill Log"
37
+ "paymill_error_text_no_entry_selected","Please select an entry"
38
+ "paymill_action_delete", "Delete selection"
39
+ "paymill_dialog_confirm", "Are you sure?"
40
+ "paymill_backend_log_id","ID"
41
+ "paymill_backend_log_entry_date","Entry date"
42
+ "paymill_backend_log_version","Version"
43
+ "paymill_backend_log_merchant_info","Merchant Information"
44
+ "paymill_backend_log_dev_info","Developer Information"
45
+ "paymill_backend_log_dev_info_additional","Additional Developer Information"
46
+ "paymill_checkout_generating_invoice","Invoice is beeing generated"
47
+ "paymill_preAuth_active","Authorize Credit Card payments during Checkout and capture manually by generating the invoice."
48
+ "paymill_token_tolerace","Token Tolerance Value"
49
+ "paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
50
+ "paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
51
+ "paymill_log_action_success", "Action Successful"
52
+ "paymill_accepted_currency", "Accepted Currencies"
53
+ "paymill_slogan","Secure credit card payments powered by "
54
+ "paymill_slogan_elv","Direct debit payments powered by "
55
+ "paymill_error_text_invalid_cvc", "Invalid cvc"
js/paymill/paymentForm.js CHANGED
@@ -1,245 +1,245 @@
1
- //Backend Options
2
- var PAYMILL_PUBLIC_KEY = null;
3
-
4
- //State Descriptors
5
- var PAYMILL_PAYMENT_NAME = "Preparing Payment";
6
- var PAYMILL_IMAGE_PATH = null;
7
- var PAYMILL_NO_FAST_CHECKOUT = false;
8
-
9
- //Errortexts
10
- var PAYMILL_ERROR_STRING = "";
11
- var PAYMILL_ERROR_TEXT_IVALID_NUMBER = null;
12
- var PAYMILL_ERROR_TEXT_IVALID_EXPDATE = null;
13
- var PAYMILL_ERROR_TEXT_IVALID_HOLDER = null;
14
- var PAYMILL_ERROR_TEXT_IVALID_BANKCODE = null;
15
- var PAYMILL_ERROR_TEXT_IVALID_PAYMENT = null;
16
-
17
- /**
18
- * prints debug messages in the log if debug mode is active
19
- * @param {String} message
20
- */
21
- function debug(message)
22
- {
23
- debug_state = pmQuery('.paymill-option-debug').val();
24
- if(debug_state == 1){
25
- var displayName = "";
26
- if(PAYMILL_PAYMENT_NAME === 'paymill_creditcard'){
27
- displayName = 'Credit Card';
28
- }
29
- if(PAYMILL_PAYMENT_NAME === 'paymill_directdebit'){
30
- displayName = 'Direct Debit';
31
- }
32
- if(PAYMILL_PAYMENT_NAME === 'Preparing Payment'){
33
- displayName = 'Preparing Payment';
34
- }
35
-
36
- console.log("["+ displayName +"] " + message);
37
- }
38
- }
39
-
40
- /**
41
- * Event Handler for the display of the card icons
42
- */
43
- function paymillShowCardIcon()
44
- {
45
- switch(paymill.cardType(pmQuery('#paymill_creditcard_number').val())){
46
- case 'Visa':
47
- pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_visa.png" >');
48
- pmQuery('#paymill_creditcard_card_icon').show();
49
- break;
50
- case 'Mastercard':
51
- pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_mastercard.png" >');
52
- pmQuery('#paymill_creditcard_card_icon').show();
53
- break;
54
- case 'American Express':
55
- pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_amex.png" >');
56
- pmQuery('#paymill_creditcard_card_icon').show();
57
- break;
58
- case 'JCB':
59
- pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_jcb.png" >');
60
- pmQuery('#paymill_creditcard_card_icon').show();
61
- break;
62
- case 'Maestro':
63
- pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_maestro.png" >');
64
- pmQuery('#paymill_creditcard_card_icon').show();
65
- break;
66
- case 'Diners Club':
67
- pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_dinersclub.png" >');
68
- pmQuery('#paymill_creditcard_card_icon').show();
69
- break;
70
- case 'Discover':
71
- pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_discover.png" >');
72
- pmQuery('#paymill_creditcard_card_icon').show();
73
- break;
74
- default:
75
- pmQuery('#paymill_creditcard_card_icon').hide();
76
- debug("Creditcard number not according to any known pattern: "+paymill.cardType(pmQuery('#paymill_creditcard_number').val()));
77
- break;
78
- }
79
- }
80
-
81
- /**
82
- * Handles the response of the paymill bridge. saves the token in a formfield.
83
- * @param {Boolean} error
84
- * @param {response object} result
85
- */
86
- function paymillResponseHandler(error, result)
87
- {
88
- if (error) {
89
- // Appending error
90
- PAYMILL_ERROR_STRING += error.apierror + "\n";
91
- debug(error.apierror);
92
- debug("Paymill Response Handler triggered: Error.");
93
- } else {
94
- // Appending Token to form
95
- debug("Saving Token in Form: "+result.token);
96
- pmQuery('.paymill-payment-token').val(result.token);
97
- payment.save();
98
- }
99
- }
100
-
101
- /**
102
- *
103
- * @returns {Boolean}
104
- */
105
- function paymillSubmitForm()
106
- {
107
- PAYMILL_PAYMENT_NAME = pmQuery("input[name='payment[method]']:checked").val();
108
-
109
- if(PAYMILL_PAYMENT_NAME === "paymill_creditcard"){
110
- PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC = pmQuery('.paymill-payment-error-number').val();
111
- PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC = pmQuery('.paymill-payment-error-holder').val();
112
- PAYMILL_ERROR_TEXT_IVALID_CVC = pmQuery('.paymill-payment-error-cvc').val();
113
- PAYMILL_ERROR_TEXT_IVALID_EXPDATE = pmQuery('.paymill-payment-error-expdate').val();
114
- }
115
-
116
- if(PAYMILL_PAYMENT_NAME === "paymill_directdebit"){
117
- PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV = pmQuery('.paymill-payment-error-number-elv').val();
118
- PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV = pmQuery('.paymill-payment-error-holder-elv').val();
119
- PAYMILL_ERROR_TEXT_IVALID_BANKCODE = pmQuery('.paymill-payment-error-bankcode').val();;
120
- }
121
-
122
- switch(PAYMILL_PAYMENT_NAME){
123
- case "paymill_creditcard":
124
- PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-cc').val();
125
- if(PAYMILL_NO_FAST_CHECKOUT){
126
- var paymillValidator = new Validation('co-payment-form');
127
- var nv = {};
128
- nv['paymill-validate-cc-number'] = new Validator('paymill-validate-cc-number', PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC, function(v) {
129
- if (false == paymill.validateCardNumber(pmQuery('#paymill_creditcard_number').val())) {
130
- debug(PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC);
131
- return false;
132
- }
133
- return true;
134
- }, '');
135
- nv['paymill-validate-cc-expdate'] = new Validator('paymill-validate-cc-expdate', PAYMILL_ERROR_TEXT_IVALID_EXPDATE, function(v) {
136
- if (false == paymill.validateExpiry(pmQuery('#paymill_creditcard_expiry_month').val(), pmQuery('#paymill_creditcard_expiry_year').val())) {
137
- debug(PAYMILL_ERROR_TEXT_IVALID_EXPDATE);
138
- return false;
139
- }
140
- return true;
141
- }, '');
142
- nv['paymill-validate-cc-holder'] = new Validator('paymill-validate-cc-holder', PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC, function(v) {
143
- if (pmQuery('#paymill_creditcard_holdername').val() == '') {
144
- debug(PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC);
145
- return false;
146
- }
147
- return true;
148
- }, '');
149
- nv['paymill-validate-cc-cvc'] = new Validator('paymill-validate-cc-cvc', PAYMILL_ERROR_TEXT_IVALID_CVC, function(v) {
150
- if (false == paymill.validateCvc(pmQuery('#paymill_creditcard_cvc').val())) {
151
- debug(PAYMILL_ERROR_TEXT_IVALID_CVC);
152
- return false;
153
- }
154
- return true;
155
- }, '');
156
-
157
- Object.extend(Validation.methods, nv);
158
-
159
- if(!paymillValidator.validate()) {
160
- return false;
161
- }
162
-
163
- var params = {
164
- amount_int: parseInt(pmQuery('.paymill-payment-amount').val()), // E.g. "15" for 0.15 Eur
165
- currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
166
- number: pmQuery('#paymill_creditcard_number').val(),
167
- exp_month: pmQuery('#paymill_creditcard_expiry_month').val(),
168
- exp_year: pmQuery('#paymill_creditcard_expiry_year').val(),
169
- cvc: pmQuery('#paymill_creditcard_cvc').val(),
170
- cardholdername: pmQuery('#paymill_creditcard_holdername').val()
171
- };
172
- }
173
- break;
174
-
175
- case "paymill_directdebit":
176
- PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-elv').val();
177
- if(PAYMILL_NO_FAST_CHECKOUT){
178
- var paymillValidator = new Validation('co-payment-form');
179
- var nv = {};
180
- nv['paymill-validate-dd-holdername'] = new Validator('paymill-validate-dd-holdername', PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV, function(v) {
181
- if (false == pmQuery('#paymill_directdebit_holdername').val()) {
182
- debug(PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV);
183
- return false;
184
- }
185
- return true;
186
- }, '');
187
- nv['paymill-validate-dd-account'] = new Validator('paymill-validate-dd-account', PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV, function(v) {
188
- if (false == paymill.validateAccountNumber(pmQuery('#paymill_directdebit_account').val())) {
189
- debug(PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV);
190
- return false;
191
- }
192
- return true;
193
- }, '');
194
- nv['paymill-validate-dd-bankcode'] = new Validator('paymill-validate-dd-bankcode', PAYMILL_ERROR_TEXT_IVALID_BANKCODE, function(v) {
195
- if (false == paymill.validateBankCode(pmQuery('#paymill_directdebit_bankcode').val())) {
196
- debug(PAYMILL_ERROR_TEXT_IVALID_BANKCODE);
197
- return false;
198
- }
199
- return true;
200
- }, '');
201
-
202
- Object.extend(Validation.methods, nv);
203
-
204
- if(!paymillValidator.validate()) {
205
- return false;
206
- }
207
-
208
- var params = {
209
- amount_int: pmQuery('.paymill-payment-amount').val(), // E.g. "15" for 0.15 Eur
210
- currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
211
- number: pmQuery('#paymill_directdebit_account').val(),
212
- bank: pmQuery('#paymill_directdebit_bankcode').val(),
213
- accountholder: pmQuery('#paymill_directdebit_holdername').val()
214
- };
215
- }
216
- break;
217
-
218
- default:
219
- payment.save();
220
- return false;
221
- break;
222
- }
223
-
224
- if(PAYMILL_NO_FAST_CHECKOUT){
225
- debug("Generating Token");
226
- paymill.createToken(params, paymillResponseHandler);
227
- } else {
228
- debug("FastCheckout Data found. Skipping Token generation.");
229
- payment.save();
230
- }
231
-
232
- return false;
233
- }
234
-
235
-
236
- pmQuery(document).ready(function()
237
- {
238
- //Gather Data
239
- PAYMILL_PUBLIC_KEY = pmQuery('.paymill-info-public_key').val();
240
-
241
- pmQuery('#paymill_creditcard_number').live('input', paymillShowCardIcon);
242
- pmQuery('#payment-buttons-container button:first').prop("onclick", null);
243
- pmQuery('#payment-buttons-container button:first').unbind('click');
244
- pmQuery('#payment-buttons-container button:first').click(paymillSubmitForm);
245
- });
1
+ //Backend Options
2
+ var PAYMILL_PUBLIC_KEY = null;
3
+
4
+ //State Descriptors
5
+ var PAYMILL_PAYMENT_NAME = "Preparing Payment";
6
+ var PAYMILL_IMAGE_PATH = null;
7
+ var PAYMILL_NO_FAST_CHECKOUT = false;
8
+
9
+ //Errortexts
10
+ var PAYMILL_ERROR_STRING = "";
11
+ var PAYMILL_ERROR_TEXT_IVALID_NUMBER = null;
12
+ var PAYMILL_ERROR_TEXT_IVALID_EXPDATE = null;
13
+ var PAYMILL_ERROR_TEXT_IVALID_HOLDER = null;
14
+ var PAYMILL_ERROR_TEXT_IVALID_BANKCODE = null;
15
+ var PAYMILL_ERROR_TEXT_IVALID_PAYMENT = null;
16
+
17
+ /**
18
+ * prints debug messages in the log if debug mode is active
19
+ * @param {String} message
20
+ */
21
+ function debug(message)
22
+ {
23
+ debug_state = pmQuery('.paymill-option-debug').val();
24
+ if (debug_state == 1) {
25
+ var displayName = "";
26
+ if (PAYMILL_PAYMENT_NAME === 'paymill_creditcard') {
27
+ displayName = 'Credit Card';
28
+ }
29
+ if (PAYMILL_PAYMENT_NAME === 'paymill_directdebit') {
30
+ displayName = 'Direct Debit';
31
+ }
32
+ if (PAYMILL_PAYMENT_NAME === 'Preparing Payment') {
33
+ displayName = 'Preparing Payment';
34
+ }
35
+
36
+ console.log("[" + displayName + "] " + message);
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Event Handler for the display of the card icons
42
+ */
43
+ function paymillShowCardIcon()
44
+ {
45
+ switch(paymill.cardType(pmQuery('#paymill_creditcard_number').val())){
46
+ case 'Visa':
47
+ pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_visa.png" >');
48
+ pmQuery('#paymill_creditcard_card_icon').show();
49
+ break;
50
+ case 'MasterCard':
51
+ pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_mastercard.png" >');
52
+ pmQuery('#paymill_creditcard_card_icon').show();
53
+ break;
54
+ case 'American Express':
55
+ pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_amex.png" >');
56
+ pmQuery('#paymill_creditcard_card_icon').show();
57
+ break;
58
+ case 'JCB':
59
+ pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_jcb.png" >');
60
+ pmQuery('#paymill_creditcard_card_icon').show();
61
+ break;
62
+ case 'Maestro':
63
+ pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_maestro.png" >');
64
+ pmQuery('#paymill_creditcard_card_icon').show();
65
+ break;
66
+ case 'Diners Club':
67
+ pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_dinersclub.png" >');
68
+ pmQuery('#paymill_creditcard_card_icon').show();
69
+ break;
70
+ case 'Discover':
71
+ pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_discover.png" >');
72
+ pmQuery('#paymill_creditcard_card_icon').show();
73
+ break;
74
+ default:
75
+ pmQuery('#paymill_creditcard_card_icon').hide();
76
+ debug("Creditcard number not according to any known pattern: "+paymill.cardType(pmQuery('#paymill_creditcard_number').val()));
77
+ break;
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Handles the response of the paymill bridge. saves the token in a formfield.
83
+ * @param {Boolean} error
84
+ * @param {response object} result
85
+ */
86
+ function paymillResponseHandler(error, result)
87
+ {
88
+ if (error) {
89
+ // Appending error
90
+ PAYMILL_ERROR_STRING += error.apierror + "\n";
91
+ debug(error.apierror);
92
+ debug("Paymill Response Handler triggered: Error.");
93
+ } else {
94
+ // Appending Token to form
95
+ debug("Saving Token in Form: " + result.token);
96
+ pmQuery('.paymill-payment-token').val(result.token);
97
+ payment.save();
98
+ }
99
+ }
100
+
101
+ /**
102
+ *
103
+ * @returns {Boolean}
104
+ */
105
+ function paymillSubmitForm()
106
+ {
107
+ PAYMILL_PAYMENT_NAME = pmQuery("input[name='payment[method]']:checked").val();
108
+
109
+ if (PAYMILL_PAYMENT_NAME === "paymill_creditcard") {
110
+ paymill.config('3ds_cancel_label', pmQuery('.paymill_3ds_cancel').val());
111
+ PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC = pmQuery('.paymill-payment-error-number').val();
112
+ PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC = pmQuery('.paymill-payment-error-holder').val();
113
+ PAYMILL_ERROR_TEXT_IVALID_CVC = pmQuery('.paymill-payment-error-cvc').val();
114
+ PAYMILL_ERROR_TEXT_IVALID_EXPDATE = pmQuery('.paymill-payment-error-expdate').val();
115
+ }
116
+
117
+ if (PAYMILL_PAYMENT_NAME === "paymill_directdebit") {
118
+ PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV = pmQuery('.paymill-payment-error-number-elv').val();
119
+ PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV = pmQuery('.paymill-payment-error-holder-elv').val();
120
+ PAYMILL_ERROR_TEXT_IVALID_BANKCODE = pmQuery('.paymill-payment-error-bankcode').val();
121
+ }
122
+
123
+ switch (PAYMILL_PAYMENT_NAME) {
124
+ case "paymill_creditcard":
125
+ PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-cc').val();
126
+ if (PAYMILL_NO_FAST_CHECKOUT) {
127
+ var paymillValidator = new Validation('co-payment-form');
128
+ var nv = {};
129
+ nv['paymill-validate-cc-number'] = new Validator('paymill-validate-cc-number', PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC, function(v) {
130
+ if (false == paymill.validateCardNumber(pmQuery('#paymill_creditcard_number').val())) {
131
+ debug(PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC);
132
+ return false;
133
+ }
134
+ return true;
135
+ }, '');
136
+ nv['paymill-validate-cc-expdate'] = new Validator('paymill-validate-cc-expdate', PAYMILL_ERROR_TEXT_IVALID_EXPDATE, function(v) {
137
+ if (false == paymill.validateExpiry(pmQuery('#paymill_creditcard_expiry_month').val(), pmQuery('#paymill_creditcard_expiry_year').val())) {
138
+ debug(PAYMILL_ERROR_TEXT_IVALID_EXPDATE);
139
+ return false;
140
+ }
141
+ return true;
142
+ }, '');
143
+ nv['paymill-validate-cc-holder'] = new Validator('paymill-validate-cc-holder', PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC, function(v) {
144
+ if (pmQuery('#paymill_creditcard_holdername').val() == '') {
145
+ debug(PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC);
146
+ return false;
147
+ }
148
+ return true;
149
+ }, '');
150
+ nv['paymill-validate-cc-cvc'] = new Validator('paymill-validate-cc-cvc', PAYMILL_ERROR_TEXT_IVALID_CVC, function(v) {
151
+ if (false == paymill.validateCvc(pmQuery('#paymill_creditcard_cvc').val())) {
152
+ debug(PAYMILL_ERROR_TEXT_IVALID_CVC);
153
+ return false;
154
+ }
155
+ return true;
156
+ }, '');
157
+
158
+ Object.extend(Validation.methods, nv);
159
+
160
+ if (!paymillValidator.validate()) {
161
+ return false;
162
+ }
163
+
164
+ var params = {
165
+ amount_int: parseInt(pmQuery('.paymill-payment-amount').val()), // E.g. "15" for 0.15 Eur
166
+ currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
167
+ number: pmQuery('#paymill_creditcard_number').val(),
168
+ exp_month: pmQuery('#paymill_creditcard_expiry_month').val(),
169
+ exp_year: pmQuery('#paymill_creditcard_expiry_year').val(),
170
+ cvc: pmQuery('#paymill_creditcard_cvc').val(),
171
+ cardholdername: pmQuery('#paymill_creditcard_holdername').val()
172
+ };
173
+ }
174
+ break;
175
+
176
+ case "paymill_directdebit":
177
+ PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-elv').val();
178
+ if (PAYMILL_NO_FAST_CHECKOUT) {
179
+ var paymillValidator = new Validation('co-payment-form');
180
+ var nv = {};
181
+ nv['paymill-validate-dd-holdername'] = new Validator('paymill-validate-dd-holdername', PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV, function(v) {
182
+ if (false == pmQuery('#paymill_directdebit_holdername').val()) {
183
+ debug(PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV);
184
+ return false;
185
+ }
186
+ return true;
187
+ }, '');
188
+ nv['paymill-validate-dd-account'] = new Validator('paymill-validate-dd-account', PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV, function(v) {
189
+ if (false == paymill.validateAccountNumber(pmQuery('#paymill_directdebit_account').val())) {
190
+ debug(PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV);
191
+ return false;
192
+ }
193
+ return true;
194
+ }, '');
195
+ nv['paymill-validate-dd-bankcode'] = new Validator('paymill-validate-dd-bankcode', PAYMILL_ERROR_TEXT_IVALID_BANKCODE, function(v) {
196
+ if (false == paymill.validateBankCode(pmQuery('#paymill_directdebit_bankcode').val())) {
197
+ debug(PAYMILL_ERROR_TEXT_IVALID_BANKCODE);
198
+ return false;
199
+ }
200
+ return true;
201
+ }, '');
202
+
203
+ Object.extend(Validation.methods, nv);
204
+
205
+ if (!paymillValidator.validate()) {
206
+ return false;
207
+ }
208
+
209
+ var params = {
210
+ amount_int: pmQuery('.paymill-payment-amount').val(), // E.g. "15" for 0.15 Eur
211
+ currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
212
+ number: pmQuery('#paymill_directdebit_account').val(),
213
+ bank: pmQuery('#paymill_directdebit_bankcode').val(),
214
+ accountholder: pmQuery('#paymill_directdebit_holdername').val()
215
+ };
216
+ }
217
+ break;
218
+
219
+ default:
220
+ payment.save();
221
+ return false;
222
+ break;
223
+ }
224
+
225
+ if (PAYMILL_NO_FAST_CHECKOUT) {
226
+ debug("Generating Token");
227
+ paymill.createToken(params, paymillResponseHandler);
228
+ } else {
229
+ debug("FastCheckout Data found. Skipping Token generation.");
230
+ payment.save();
231
+ }
232
+
233
+ return false;
234
+ }
235
+
236
+
237
+ pmQuery(document).ready(function()
238
+ {
239
+ //Gather Data
240
+ PAYMILL_PUBLIC_KEY = pmQuery('.paymill-info-public_key').val();
241
+ pmQuery('#paymill_creditcard_number').live('input', paymillShowCardIcon);
242
+ pmQuery('#payment-buttons-container button:first').prop("onclick", null);
243
+ pmQuery('#payment-buttons-container button:first').unbind('click');
244
+ pmQuery('#payment-buttons-container button:first').click(paymillSubmitForm);
245
+ });
lib/Services/Paymill/Apiclient/Curl.php CHANGED
@@ -1,159 +1,159 @@
1
- <?php
2
-
3
- require_once 'Interface.php';
4
-
5
- require_once realpath(dirname(__FILE__)) . '/../Exception.php';
6
-
7
- if (!function_exists('json_decode')) {
8
- throw new Exception("Please install the PHP JSON extension");
9
- }
10
-
11
- if (!function_exists('curl_init')) {
12
- throw new Exception("Please install the PHP cURL extension");
13
- }
14
-
15
- /**
16
- * Services_Paymill cURL HTTP client
17
- */
18
- class Services_Paymill_Apiclient_Curl implements Services_Paymill_Apiclient_Interface
19
- {
20
-
21
- /**
22
- * Paymill API merchant key
23
- *
24
- * @var string
25
- */
26
- private $_apiKey = null;
27
-
28
- private $_responseArray = null;
29
-
30
- /**
31
- * Paymill API base url
32
- *
33
- * @var string
34
- */
35
- private $_apiUrl = '/';
36
-
37
- const USER_AGENT = 'Paymill-php/0.0.2';
38
-
39
- public static $lastRawResponse;
40
- public static $lastRawCurlOptions;
41
-
42
- /**
43
- * cURL HTTP client constructor
44
- *
45
- * @param string $apiKey
46
- * @param string $apiEndpoint
47
- */
48
- public function __construct($apiKey, $apiEndpoint)
49
- {
50
- $this->_apiKey = $apiKey;
51
- $this->_apiUrl = $apiEndpoint;
52
- }
53
-
54
- /**
55
- * Perform API and handle exceptions
56
- *
57
- * @param $action
58
- * @param array $params
59
- * @param string $method
60
- * @return mixed
61
- * @throws Services_Paymill_Exception
62
- * @throws Exception
63
- */
64
- public function request($action, $params = array(), $method = 'POST')
65
- {
66
- if (!is_array($params))
67
- $params = array();
68
-
69
- try {
70
- $this->_responseArray = $this->_requestApi($action, $params, $method);
71
- $httpStatusCode = $this->_responseArray['header']['status'];
72
- if ($httpStatusCode != 200) {
73
- $errorMessage = 'Client returned HTTP status code ' . $httpStatusCode;
74
- if (isset($this->_responseArray['body']['error'])) {
75
- $errorMessage = $this->_responseArray['body']['error'];
76
- }
77
- $responseCode = '';
78
- if (isset($this->_responseArray['body']['response_code'])) {
79
- $responseCode = $this->_responseArray['body']['response_code'];
80
- }
81
-
82
- return array("data" => array(
83
- "error" => $errorMessage,
84
- "response_code" => $responseCode,
85
- "http_status_code" => $httpStatusCode
86
- ));
87
- }
88
-
89
- return $this->_responseArray['body'];
90
- } catch (Exception $e) {
91
- return array("data" => array("error" => $e->getMessage()));
92
- }
93
- }
94
-
95
- /**
96
- * Perform HTTP request to REST endpoint
97
- *
98
- * @param string $action
99
- * @param array $params
100
- * @param string $method
101
- * @return array
102
- */
103
- protected function _requestApi($action = '', $params = array(), $method = 'POST')
104
- {
105
- $curlOpts = array(
106
- CURLOPT_URL => $this->_apiUrl . $action,
107
- CURLOPT_RETURNTRANSFER => true,
108
- CURLOPT_CUSTOMREQUEST => $method,
109
- CURLOPT_USERAGENT => self::USER_AGENT,
110
- CURLOPT_SSL_VERIFYPEER => true,
111
- CURLOPT_CAINFO => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'paymill.crt',
112
- );
113
-
114
- if (Services_Paymill_Apiclient_Interface::HTTP_GET === $method) {
115
- if (0 !== count($params)) {
116
- $curlOpts[CURLOPT_URL] .= false === strpos($curlOpts[CURLOPT_URL], '?') ? '?' : '&';
117
- $curlOpts[CURLOPT_URL] .= http_build_query($params, null, '&');
118
- }
119
- } else {
120
- $curlOpts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
121
- }
122
-
123
- if ($this->_apiKey) {
124
- $curlOpts[CURLOPT_USERPWD] = $this->_apiKey . ':';
125
- }
126
-
127
- $curl = curl_init();
128
- curl_setopt_array($curl, $curlOpts);
129
- $responseBody = curl_exec($curl);
130
- self::$lastRawCurlOptions = $curlOpts;
131
- self::$lastRawResponse = $responseBody;
132
- $responseInfo = curl_getinfo($curl);
133
- if ($responseBody === false) {
134
- $responseBody = array('error' => curl_error($curl));
135
- }
136
- curl_close($curl);
137
-
138
- if ('application/json' === $responseInfo['content_type']) {
139
- $responseBody = json_decode($responseBody, true);
140
- }
141
-
142
- return array(
143
- 'header' => array(
144
- 'status' => $responseInfo['http_code'],
145
- 'reason' => null,
146
- ),
147
- 'body' => $responseBody
148
- );
149
- }
150
-
151
- /**
152
- * Returns the response of the request as an array.
153
- * @return mixed Response
154
- * @todo Create Unit Test
155
- */
156
- public function getResponse(){
157
- return $this->_responseArray;
158
- }
159
  }
1
+ <?php
2
+
3
+ require_once 'Interface.php';
4
+
5
+ require_once realpath(dirname(__FILE__)) . '/../Exception.php';
6
+
7
+ if (!function_exists('json_decode')) {
8
+ throw new Exception("Please install the PHP JSON extension");
9
+ }
10
+
11
+ if (!function_exists('curl_init')) {
12
+ throw new Exception("Please install the PHP cURL extension");
13
+ }
14
+
15
+ /**
16
+ * Services_Paymill cURL HTTP client
17
+ */
18
+ class Services_Paymill_Apiclient_Curl implements Services_Paymill_Apiclient_Interface
19
+ {
20
+
21
+ /**
22
+ * Paymill API merchant key
23
+ *
24
+ * @var string
25
+ */
26
+ private $_apiKey = null;
27
+
28
+ private $_responseArray = null;
29
+
30
+ /**
31
+ * Paymill API base url
32
+ *
33
+ * @var string
34
+ */
35
+ private $_apiUrl = '/';
36
+
37
+ const USER_AGENT = 'Paymill-php/0.0.2';
38
+
39
+ public static $lastRawResponse;
40
+ public static $lastRawCurlOptions;
41
+
42
+ /**
43
+ * cURL HTTP client constructor
44
+ *
45
+ * @param string $apiKey
46
+ * @param string $apiEndpoint
47
+ */
48
+ public function __construct($apiKey, $apiEndpoint)
49
+ {
50
+ $this->_apiKey = $apiKey;
51
+ $this->_apiUrl = $apiEndpoint;
52
+ }
53
+
54
+ /**
55
+ * Perform API and handle exceptions
56
+ *
57
+ * @param $action
58
+ * @param array $params
59
+ * @param string $method
60
+ * @return mixed
61
+ * @throws Services_Paymill_Exception
62
+ * @throws Exception
63
+ */
64
+ public function request($action, $params = array(), $method = 'POST')
65
+ {
66
+ if (!is_array($params))
67
+ $params = array();
68
+
69
+ try {
70
+ $this->_responseArray = $this->_requestApi($action, $params, $method);
71
+ $httpStatusCode = $this->_responseArray['header']['status'];
72
+ if ($httpStatusCode != 200) {
73
+ $errorMessage = 'Client returned HTTP status code ' . $httpStatusCode;
74
+ if (isset($this->_responseArray['body']['error'])) {
75
+ $errorMessage = $this->_responseArray['body']['error'];
76
+ }
77
+ $responseCode = '';
78
+ if (isset($this->_responseArray['body']['response_code'])) {
79
+ $responseCode = $this->_responseArray['body']['response_code'];
80
+ }
81
+
82
+ return array("data" => array(
83
+ "error" => $errorMessage,
84
+ "response_code" => $responseCode,
85
+ "http_status_code" => $httpStatusCode
86
+ ));
87
+ }
88
+
89
+ return $this->_responseArray['body'];
90
+ } catch (Exception $e) {
91
+ return array("data" => array("error" => $e->getMessage()));
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Perform HTTP request to REST endpoint
97
+ *
98
+ * @param string $action
99
+ * @param array $params
100
+ * @param string $method
101
+ * @return array
102
+ */
103
+ protected function _requestApi($action = '', $params = array(), $method = 'POST')
104
+ {
105
+ $curlOpts = array(
106
+ CURLOPT_URL => $this->_apiUrl . $action,
107
+ CURLOPT_RETURNTRANSFER => true,
108
+ CURLOPT_CUSTOMREQUEST => $method,
109
+ CURLOPT_USERAGENT => self::USER_AGENT,
110
+ CURLOPT_SSL_VERIFYPEER => true,
111
+ CURLOPT_CAINFO => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'paymill.crt',
112
+ );
113
+
114
+ if (Services_Paymill_Apiclient_Interface::HTTP_GET === $method) {
115
+ if (0 !== count($params)) {
116
+ $curlOpts[CURLOPT_URL] .= false === strpos($curlOpts[CURLOPT_URL], '?') ? '?' : '&';
117
+ $curlOpts[CURLOPT_URL] .= http_build_query($params, null, '&');
118
+ }
119
+ } else {
120
+ $curlOpts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
121
+ }
122
+
123
+ if ($this->_apiKey) {
124
+ $curlOpts[CURLOPT_USERPWD] = $this->_apiKey . ':';
125
+ }
126
+
127
+ $curl = curl_init();
128
+ curl_setopt_array($curl, $curlOpts);
129
+ $responseBody = curl_exec($curl);
130
+ self::$lastRawCurlOptions = $curlOpts;
131
+ self::$lastRawResponse = $responseBody;
132
+ $responseInfo = curl_getinfo($curl);
133
+ if ($responseBody === false) {
134
+ $responseBody = array('error' => curl_error($curl));
135
+ }
136
+ curl_close($curl);
137
+
138
+ if ('application/json' === $responseInfo['content_type']) {
139
+ $responseBody = json_decode($responseBody, true);
140
+ }
141
+
142
+ return array(
143
+ 'header' => array(
144
+ 'status' => $responseInfo['http_code'],
145
+ 'reason' => null,
146
+ ),
147
+ 'body' => $responseBody
148
+ );
149
+ }
150
+
151
+ /**
152
+ * Returns the response of the request as an array.
153
+ * @return mixed Response
154
+ * @todo Create Unit Test
155
+ */
156
+ public function getResponse(){
157
+ return $this->_responseArray;
158
+ }
159
  }
lib/Services/Paymill/Apiclient/Interface.php CHANGED
@@ -1,20 +1,20 @@
1
- <?php
2
-
3
- interface Services_Paymill_Apiclient_Interface
4
- {
5
- const HTTP_POST = 'POST';
6
- const HTTP_GET = 'GET';
7
- const HTTP_PUT = 'PUT';
8
- const HTTP_DELETE = 'DELETE';
9
-
10
- /**
11
- * Perform API and handle exceptions
12
- *
13
- * @param $action
14
- * @param array $params
15
- * @param string $method
16
- * @return mixed
17
- */
18
- public function request($action, $params = array(), $method = 'POST');
19
-
20
  }
1
+ <?php
2
+
3
+ interface Services_Paymill_Apiclient_Interface
4
+ {
5
+ const HTTP_POST = 'POST';
6
+ const HTTP_GET = 'GET';
7
+ const HTTP_PUT = 'PUT';
8
+ const HTTP_DELETE = 'DELETE';
9
+
10
+ /**
11
+ * Perform API and handle exceptions
12
+ *
13
+ * @param $action
14
+ * @param array $params
15
+ * @param string $method
16
+ * @return mixed
17
+ */
18
+ public function request($action, $params = array(), $method = 'POST');
19
+
20
  }
lib/Services/Paymill/Apiclient/paymill.crt CHANGED
@@ -1,25 +1,25 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
3
- MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
4
- IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
5
- MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
6
- FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
7
- bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
8
- dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
9
- H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
10
- uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
11
- mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
12
- a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
13
- E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
14
- WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
15
- VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
16
- Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
17
- cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
18
- IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
19
- AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
20
- YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
21
- 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
22
- Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
23
- c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
24
- mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
25
- -----END CERTIFICATE-----
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
3
+ MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
4
+ IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
5
+ MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
6
+ FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
7
+ bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
8
+ dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
9
+ H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
10
+ uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
11
+ mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
12
+ a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
13
+ E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
14
+ WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
15
+ VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
16
+ Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
17
+ cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
18
+ IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
19
+ AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
20
+ YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
21
+ 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
22
+ Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
23
+ c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
24
+ mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
25
+ -----END CERTIFICATE-----
lib/Services/Paymill/Base.php CHANGED
@@ -1,145 +1,145 @@
1
- <?php
2
-
3
- require_once 'Apiclient/Curl.php';
4
- /**
5
- * Paymill API wrapper super class
6
- */
7
- abstract class Services_Paymill_Base
8
- {
9
- /**
10
- * Resource relative url path name ending with '/', set or override in subclass
11
- *
12
- * @var string
13
- */
14
- protected $_serviceResource = null;
15
-
16
- /**
17
- * Paymill HTTP client class
18
- *
19
- * @var Services_Paymill_Apiclient_Interface
20
- */
21
- protected $_httpClient;
22
-
23
- /**
24
- * Base constructor
25
- * sets _httpClient property
26
- *
27
- * @param string $apiKey merchant api key
28
- * @param string $apiEndpoint endpoint URL for the api
29
- */
30
- public function __construct($apiKey, $apiEndpoint)
31
- {
32
- $this->_httpClient = new Services_Paymill_Apiclient_Curl($apiKey, $apiEndpoint);
33
- }
34
-
35
- /**
36
- * General REST GET verb
37
- *
38
- * @param array $filters e.g. count,offest
39
- * @param string $identifier resource id
40
- *
41
- * @return array of resource items
42
- */
43
- public function get($filters = array(), $identifier = '')
44
- {
45
- $response = $this->_httpClient->request(
46
- $this->_serviceResource . $identifier,
47
- $filters,
48
- Services_Paymill_Apiclient_Interface::HTTP_GET
49
- );
50
-
51
- return $response['data'];
52
- }
53
-
54
- /**
55
- * General REST GET verb
56
- * returns one item or null
57
- *
58
- * @param string $identifier resource id
59
- *
60
- * @return array resource item | null
61
- */
62
- public function getOne($identifier = null)
63
- {
64
- if (!$identifier) {
65
- return null;
66
- }
67
-
68
- $filters = array("count" => 1, 'offset' => 0);
69
-
70
- return $this->get($filters, $identifier);
71
- }
72
-
73
- /**
74
- * General REST DELETE verb
75
- * Delete or inactivate/cancel resource item
76
- *
77
- * @param string $clientId
78
- *
79
- * @return array item deleted
80
- */
81
- public function delete($clientId = null)
82
- {
83
- $response = $this->_httpClient->request(
84
- $this->_serviceResource . $clientId,
85
- array(),
86
- Services_Paymill_Apiclient_Interface::HTTP_DELETE
87
- );
88
-
89
- return $response['data'];
90
- }
91
-
92
- /**
93
- * General REST POST verb
94
- * create resource item
95
- *
96
- * @param array $itemData
97
- *
98
- * @return array created item
99
- */
100
- public function create($itemData = array())
101
- {
102
- $response = $this->_httpClient->request(
103
- $this->_serviceResource,
104
- $itemData,
105
- Services_Paymill_Apiclient_Interface::HTTP_POST
106
- );
107
-
108
- return $response['data'];
109
- }
110
-
111
- /**
112
- * General REST PUT verb
113
- * Update resource item
114
- *
115
- * @param array $itemData
116
- *
117
- * @return array item updated or null
118
- */
119
- public function update(array $itemData = array())
120
- {
121
- if (!isset($itemData['id']) ) {
122
- return null;
123
- }
124
-
125
- $itemId = $itemData['id'];
126
- unset ($itemData['id']);
127
-
128
- $response = $this->_httpClient->request(
129
- $this->_serviceResource . $itemId,
130
- $itemData,
131
- Services_Paymill_Apiclient_Interface::HTTP_PUT
132
- );
133
-
134
- return $response['data'];
135
- }
136
-
137
- /**
138
- * Returns the response of the last request as an array
139
- * @return mixed Response
140
- * @todo Add Unit test
141
- */
142
- public function getResponse(){
143
- return $this->_httpClient->getResponse();
144
- }
145
  }
1
+ <?php
2
+
3
+ require_once 'Apiclient/Curl.php';
4
+ /**
5
+ * Paymill API wrapper super class
6
+ */
7
+ abstract class Services_Paymill_Base
8
+ {
9
+ /**
10
+ * Resource relative url path name ending with '/', set or override in subclass
11
+ *
12
+ * @var string
13
+ */
14
+ protected $_serviceResource = null;
15
+
16
+ /**
17
+ * Paymill HTTP client class
18
+ *
19
+ * @var Services_Paymill_Apiclient_Interface
20
+ */
21
+ protected $_httpClient;
22
+
23
+ /**
24
+ * Base constructor
25
+ * sets _httpClient property
26
+ *
27
+ * @param string $apiKey merchant api key
28
+ * @param string $apiEndpoint endpoint URL for the api
29
+ */
30
+ public function __construct($apiKey, $apiEndpoint)
31
+ {
32
+ $this->_httpClient = new Services_Paymill_Apiclient_Curl($apiKey, $apiEndpoint);
33
+ }
34
+
35
+ /**
36
+ * General REST GET verb
37
+ *
38
+ * @param array $filters e.g. count,offest
39
+ * @param string $identifier resource id
40
+ *
41
+ * @return array of resource items
42
+ */
43
+ public function get($filters = array(), $identifier = '')
44
+ {
45
+ $response = $this->_httpClient->request(
46
+ $this->_serviceResource . $identifier,
47
+ $filters,
48
+ Services_Paymill_Apiclient_Interface::HTTP_GET
49
+ );
50
+
51
+ return $response['data'];
52
+ }
53
+
54
+ /**
55
+ * General REST GET verb
56
+ * returns one item or null
57
+ *
58
+ * @param string $identifier resource id
59
+ *
60
+ * @return array resource item | null
61
+ */
62
+ public function getOne($identifier = null)
63
+ {
64
+ if (!$identifier) {
65
+ return null;
66
+ }
67
+
68
+ $filters = array("count" => 1, 'offset' => 0);
69
+
70
+ return $this->get($filters, $identifier);
71
+ }
72
+
73
+ /**
74
+ * General REST DELETE verb
75
+ * Delete or inactivate/cancel resource item
76
+ *
77
+ * @param string $clientId
78
+ *
79
+ * @return array item deleted
80
+ */
81
+ public function delete($clientId = null)
82
+ {
83
+ $response = $this->_httpClient->request(
84
+ $this->_serviceResource . $clientId,
85
+ array(),
86
+ Services_Paymill_Apiclient_Interface::HTTP_DELETE
87
+ );
88
+
89
+ return $response['data'];
90
+ }
91
+
92
+ /**
93
+ * General REST POST verb
94
+ * create resource item
95
+ *
96
+ * @param array $itemData
97
+ *
98
+ * @return array created item
99
+ */
100
+ public function create($itemData = array())
101
+ {
102
+ $response = $this->_httpClient->request(
103
+ $this->_serviceResource,
104
+ $itemData,
105
+ Services_Paymill_Apiclient_Interface::HTTP_POST
106
+ );
107
+
108
+ return $response['data'];
109
+ }
110
+
111
+ /**
112
+ * General REST PUT verb
113
+ * Update resource item
114
+ *
115
+ * @param array $itemData
116
+ *
117
+ * @return array item updated or null
118
+ */
119
+ public function update(array $itemData = array())
120
+ {
121
+ if (!isset($itemData['id']) ) {
122
+ return null;
123
+ }
124
+
125
+ $itemId = $itemData['id'];
126
+ unset ($itemData['id']);
127
+
128
+ $response = $this->_httpClient->request(
129
+ $this->_serviceResource . $itemId,
130
+ $itemData,
131
+ Services_Paymill_Apiclient_Interface::HTTP_PUT
132
+ );
133
+
134
+ return $response['data'];
135
+ }
136
+
137
+ /**
138
+ * Returns the response of the last request as an array
139
+ * @return mixed Response
140
+ * @todo Add Unit test
141
+ */
142
+ public function getResponse(){
143
+ return $this->_httpClient->getResponse();
144
+ }
145
  }
lib/Services/Paymill/Clients.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for clients resource
7
- */
8
- class Services_Paymill_Clients extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'clients/';
14
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for clients resource
7
+ */
8
+ class Services_Paymill_Clients extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'clients/';
14
  }
lib/Services/Paymill/Exception.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
-
3
- /**
4
- * Services_Paymill_Exception class
5
- */
6
- class Services_Paymill_Exception extends Exception
7
- {
8
- /**
9
- * Constructor for exception object
10
- *
11
- * @return void
12
- */
13
- public function __construct($message, $code)
14
- {
15
- parent::__construct($message, $code);
16
- }
17
  }
1
+ <?php
2
+
3
+ /**
4
+ * Services_Paymill_Exception class
5
+ */
6
+ class Services_Paymill_Exception extends Exception
7
+ {
8
+ /**
9
+ * Constructor for exception object
10
+ *
11
+ * @return void
12
+ */
13
+ public function __construct($message, $code)
14
+ {
15
+ parent::__construct($message, $code);
16
+ }
17
  }
lib/Services/Paymill/LoggingInterface.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- interface Services_Paymill_LoggingInterface
4
- {
5
-
6
- /**
7
- * Logging for PaymentProcessor
8
- *
9
- * @param type $message
10
- * @param type $debugInfo
11
- */
12
- public function log($message, $debugInfo = null, $additionalInformation = null);
13
-
14
- }
1
+ <?php
2
+
3
+ interface Services_Paymill_LoggingInterface
4
+ {
5
+
6
+ /**
7
+ * Logging for PaymentProcessor
8
+ *
9
+ * @param type $message
10
+ * @param type $debugInfo
11
+ */
12
+ public function log($message, $debugInfo = null, $additionalInformation = null);
13
+
14
+ }
lib/Services/Paymill/Offers.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for offers resource
7
- */
8
- class Services_Paymill_Offers extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'offers/';
14
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for offers resource
7
+ */
8
+ class Services_Paymill_Offers extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'offers/';
14
  }
lib/Services/Paymill/PaymentProcessor.php CHANGED
@@ -1,549 +1,549 @@
1
- <?php
2
-
3
- /**
4
- * This class acts as an easy to use gateway for the paymill phph wrapper.
5
- * @version 1.0.0
6
- * @category PayIntelligent
7
- * @copyright Copyright (c) 2013 PayIntelligent GmbH (http://payintelligent.de)
8
- */
9
- class Services_Paymill_PaymentProcessor
10
- {
11
-
12
- //Options: Variables needed to create Paymill Lib Components
13
- private $_libBase;
14
- private $_privateKey;
15
- private $_apiUrl;
16
- //Objects: Objects used by the methods
17
- private $_transactionsObject;
18
- private $_preauthObject;
19
- private $_clientsObject;
20
- private $_paymentsObject;
21
- private $_logger; //Only this object can be set using a set function.
22
- //Process Payment relevant
23
- private $_token; //Token generated for the Transaction
24
- private $_amount; //Current Amount
25
- private $_preAuthAmount;
26
- private $_currency; //Currency (of both amounts)
27
- private $_name; //Customername
28
- private $_email; //Customer Email Adress
29
- private $_description;
30
- private $_lastResponse;
31
- private $_transactionId; //Transaction Id generated by the createTransaction function.
32
- private $_preauthId;
33
- //Fast Checkout Variables
34
- private $_clientId = null;
35
- private $_paymentId = null;
36
- //Source
37
- private $_source;
38
-
39
- /**
40
- * Creates an object of the PaymentProcessor class.
41
- * @param String <b>$privateKey</b> Paymill-PrivateKey
42
- * @param String <b>$apiUrl</b> Paymill-Api Url
43
- * @param String <b>$libBase</b> Path to the lib Base (Can be null, Default Path will be used)
44
- * @param array <b>$params</b>( <br />
45
- * <b>token</b>, generated Token <br />
46
- * <b>amount</b>, Basketamount <br />
47
- * <b>currency</b>, Transaction currency <br />
48
- * <b>name</b>, Customer name <br />
49
- * <b>email</b>, Customer emailaddress <br />
50
- * <b>description</b>, Description for transactions <br />
51
- * ) <p color='red'><b>(If not set here, the use of setters is required for the class to work)</b></p>
52
- * @param object $loggingClassInstance Instance of Object implementing the Services_Paymill_PaymentProcessorInterface. If not set, there will be no logging.
53
- */
54
- public function __construct($privateKey = null, $apiUrl = null, $libBase = null, $params = null, Services_Paymill_LoggingInterface $loggingClassInstance = null)
55
- {
56
- $this->setPrivateKey($privateKey);
57
- $this->setApiUrl($apiUrl);
58
- $this->setLibBase($libBase);
59
- $this->_preAuthAmount = isset($params['preauthamount']) ? $params['preauthamount'] : 0;
60
- $this->_token = $params['token'];
61
- $this->_amount = $params['amount'];
62
- $this->_currency = $params['currency'];
63
- $this->_name = $params['name'];
64
- $this->_email = $params['email'];
65
- $this->_description = $params['description'];
66
- $this->setLogger($loggingClassInstance);
67
- }
68
-
69
- /**
70
- * Creates a Paymill-Client with the given Data
71
- *
72
- * @param array $params
73
- * @return boolean
74
- */
75
- private function _createClient()
76
- {
77
- if (isset($this->_clientId)) {
78
- $this->_log("Client using: " . $this->_clientId);
79
- } else {
80
- $client = $this->_clientsObject->create(
81
- array(
82
- 'email' => $this->_email,
83
- 'description' => $this->_description
84
- )
85
- );
86
-
87
- $this->_validateResult($client, 'Client');
88
-
89
- $this->_clientId = $client['id'];
90
- }
91
- return $this->_clientId;
92
- }
93
-
94
- /**
95
- * Creates a Paymill-Payment with the given Data
96
- *
97
- * @param array $params
98
- * @return boolean
99
- */
100
- private function _createPayment()
101
- {
102
- if (isset($this->_paymentId)) {
103
- $this->_log("Payment using: " . $this->_paymentId);
104
- } else {
105
- $payment = $this->_paymentsObject->create(
106
- array(
107
- 'token' => $this->_token,
108
- 'client' => $this->_clientId
109
- )
110
- );
111
- $this->_validateResult($payment, 'Payment');
112
-
113
- $this->_paymentId = $payment['id'];
114
- }
115
- return true;
116
- }
117
-
118
- /**
119
- * Creates a Paymill-Transaction with the given Data
120
- *
121
- * @param array $params
122
- * @return boolean
123
- */
124
- private function _createTransaction()
125
- {
126
- $transaction = $this->_transactionsObject->create(
127
- array(
128
- 'amount' => $this->_amount,
129
- 'currency' => $this->_currency,
130
- 'description' => $this->_description,
131
- 'preauthorization' => $this->_preauthId,
132
- 'source' => $this->_source
133
- )
134
- );
135
- $this->_validateResult($transaction, 'Transaction');
136
-
137
- $this->_transactionId = $transaction['id'];
138
- return true;
139
- }
140
-
141
- /**
142
- * Creates a Paymill-Transaction with the given Data
143
- *
144
- * @param array $params
145
- * @return boolean
146
- */
147
- private function _createPreauthorization()
148
- {
149
- $preAuth = $this->_preauthObject->create(
150
- array(
151
- 'amount' => $this->_preAuthAmount,
152
- 'currency' => $this->_currency,
153
- 'description' => $this->_description,
154
- 'payment' => $this->_paymentId,
155
- 'client' => $this->_clientId,
156
- )
157
- );
158
- $this->_validateResult($preAuth, 'Preauthorization');
159
- $this->_preauthId = $preAuth['preauthorization']['id'];
160
- return true;
161
- }
162
-
163
- /**
164
- * Load the PhpWrapper-Classes and creates an instance for each class.
165
- */
166
- private function _initiatePhpWrapperClasses()
167
- {
168
- require_once $this->_libBase . 'Transactions.php';
169
- require_once $this->_libBase . 'Preauthorizations.php';
170
- require_once $this->_libBase . 'Clients.php';
171
- require_once $this->_libBase . 'Payments.php';
172
-
173
- $this->_transactionsObject = new Services_Paymill_Transactions($this->_privateKey, $this->_apiUrl);
174
- $this->_preauthObject = new Services_Paymill_Preauthorizations($this->_privateKey, $this->_apiUrl);
175
- $this->_clientsObject = new Services_Paymill_Clients($this->_privateKey, $this->_apiUrl);
176
- $this->_paymentsObject = new Services_Paymill_Payments($this->_privateKey, $this->_apiUrl);
177
- }
178
-
179
- /**
180
- * Calls the log() function of the logger object if the object has been set.
181
- *
182
- * @param string $message
183
- * @param string $debugInfo
184
- */
185
- private function _log($message, $debugInfo = null)
186
- {
187
- if (isset($this->_logger)) {
188
- $this->_logger->log($message, $debugInfo);
189
- }
190
- }
191
-
192
- /**
193
- * Validates the array passed as an argument to be processPayment() compliant
194
- * @param mixed $parameter
195
- * @return boolean
196
- */
197
- private function _validateParameter()
198
- {
199
- if($this->_preAuthAmount == null){
200
- $this->_preAuthAmount = $this->_amount;
201
- }
202
-
203
- $validation = true;
204
- $parameter = array(
205
- "token" => $this->_token,
206
- "amount" => $this->_amount,
207
- "currency" => $this->_currency,
208
- "name" => $this->_name,
209
- "email" => $this->_email,
210
- "description" => $this->_description);
211
-
212
- $arrayMask = array(
213
- "token" => 'string',
214
- "amount" => 'integer',
215
- "currency" => 'string',
216
- "name" => 'string',
217
- "email" => 'string',
218
- "description" => 'string');
219
-
220
- foreach ($arrayMask as $mask => $type) {
221
- if (is_null($parameter[$mask])) {
222
- $validation = false;
223
- $this->_log("The Parameter $mask is missing.", var_export($parameter, true));
224
- } else {
225
- switch ($type) {
226
- case 'string':
227
- if (!is_string($parameter[$mask])) {
228
- $this->_log("The Parameter $mask is not a string.", var_export($parameter, true));
229
- $validation = false;
230
- }
231
- break;
232
- case 'integer':
233
- if (!is_integer($parameter[$mask])) {
234
- $this->_log("The Parameter $mask is not an integer.", var_export($parameter, true));
235
- $validation = false;
236
- }
237
- break;
238
- }
239
- }
240
-
241
- if (!$validation) {
242
- break;
243
- }
244
- }
245
- return $validation;
246
- }
247
-
248
- /**
249
- * Validates the created Paymill-Objects
250
- *
251
- * @param array $transaction
252
- * @param string $type
253
- * @return boolean
254
- */
255
- private function _validateResult($transaction, $type)
256
- {
257
- $this->_lastResponse = $transaction;
258
- if (isset($transaction['data']['response_code']) && $transaction['data']['response_code'] !== 20000) {
259
- $this->_log("An Error occured: " . $transaction['data']['response_code'], var_export($transaction, true));
260
- throw new Exception("Invalid Result Exception: Invalid ResponseCode");
261
- }
262
-
263
- if (!isset($transaction['id']) && !isset($transaction['data']['id'])) {
264
- $this->_log("No $type created.", var_export($transaction, true));
265
- throw new Exception("Invalid Result Exception: Invalid Id");
266
- } else {
267
- $this->_log("$type created.", isset($transaction['id']) ? $transaction['id'] : $transaction['data']['id']);
268
- }
269
-
270
- // check result
271
- if ($type == 'Transaction') {
272
- if (is_array($transaction) && array_key_exists('status', $transaction)) {
273
- if ($transaction['status'] == "closed") {
274
- // transaction was successfully issued
275
- return true;
276
- } elseif ($transaction['status'] == "open") {
277
- // transaction was issued but status is open for any reason
278
- $this->_log("Status is open.", var_export($transaction, true));
279
- throw new Exception("Invalid Result Exception: Invalid Orderstate");
280
- } else {
281
- // another error occured
282
- $this->_log("Unknown error." . var_export($transaction, true));
283
- throw new Exception("Invalid Result Exception: Unknown Error");
284
- }
285
- } else {
286
- // another error occured
287
- $this->_log("$type could not be issued.", var_export($transaction, true));
288
- throw new Exception("Invalid Result Exception: $type could not be issued.");
289
- }
290
- } else {
291
- return true;
292
- }
293
- }
294
-
295
- /**
296
- * Executes the Payment Process
297
- *
298
- * @return boolean
299
- */
300
- final public function processPayment($captureNow = true)
301
- {
302
- $this->_initiatePhpWrapperClasses();
303
- if (!$this->_validateParameter()) {
304
- return false;
305
- }
306
-
307
- try {
308
- $this->_createClient();
309
- $this->_createPayment();
310
- $this->_createPreauthorization();
311
- if($captureNow){
312
- $this->_createTransaction();
313
- }
314
- return true;
315
- } catch (Exception $ex) {
316
- // paymill wrapper threw an exception
317
- $this->_log("Exception thrown from paymill wrapper.", $ex->getMessage());
318
- return false;
319
- }
320
- }
321
-
322
- final public function capture(){
323
- $this->_initiatePhpWrapperClasses();
324
- if(!isset($this->_amount) || !isset($this->_currency) || !isset($this->_preauthId)){
325
- return false;
326
- }
327
- return $this->_createTransaction();
328
- }
329
-
330
- /**
331
- * Returns the objects data
332
- *
333
- * @return array
334
- */
335
- public function toArray()
336
- {
337
- return array(
338
- 'apiurl' => $this->_apiUrl,
339
- 'libbase' => $this->_libBase,
340
- 'privatekey' => $this->_privateKey,
341
- 'logger' => $this->_logger,
342
- 'token' => $this->_token,
343
- 'amount' => $this->_amount,
344
- 'preauthamount' => $this->_preAuthAmount,
345
- 'currency' => $this->_currency,
346
- 'description' => $this->_description,
347
- 'email' => $this->_email,
348
- 'name' => $this->_name,
349
- 'source' => $this->_source
350
- );
351
- }
352
-
353
- /* * **************************************************************************************************************
354
- * *********************************************** Getter **************************************************
355
- * *************************************************************************************************************** */
356
-
357
- /**
358
- * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
359
- * Returns the ClientId
360
- * @return String ClientId
361
- */
362
- public function getClientId()
363
- {
364
- return $this->_clientId;
365
- }
366
-
367
- /**
368
- * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
369
- * Returns the PaymentId
370
- * @return String PaymentId
371
- */
372
- public function getPaymentId()
373
- {
374
- return $this->_paymentId;
375
- }
376
-
377
- /**
378
- * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
379
- * Returns the TransactionId
380
- * @return String TransactionId
381
- */
382
- public function getTransactionId()
383
- {
384
- return $this->_transactionId;
385
- }
386
-
387
- /**
388
- * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
389
- * Returns the preauthId
390
- * @return String preauthId
391
- */
392
- public function getPreauthId()
393
- {
394
- return $this->_preauthId;
395
- }
396
-
397
- /**
398
- * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
399
- * Returns the last response send by Paymill
400
- * @return array LastResponse
401
- */
402
- public function getLastResponse()
403
- {
404
- return $this->_lastResponse;
405
- }
406
-
407
- /* * **************************************************************************************************************
408
- * *********************************************** Setter **************************************************
409
- * *************************************************************************************************************** */
410
-
411
- /**
412
- * Sets the clientId
413
- * @param String $clientId
414
- */
415
- public function setClientId($clientId = null)
416
- {
417
- $this->_clientId = $clientId;
418
- }
419
-
420
- /**
421
- * Sets the paymentId
422
- * @param String $paymentId
423
- */
424
- public function setPaymentId($paymentId = null)
425
- {
426
- $this->_paymentId = $paymentId;
427
- }
428
-
429
- /**
430
- * This method sets the token
431
- * @param String $token
432
- */
433
- public function setToken($token = null)
434
- {
435
- $this->_token = $token;
436
- }
437
-
438
- /**
439
- * This method sets the preAuthAmount
440
- * @param String $preAuthAmount
441
- */
442
- public function setPreAuthAmount($preAuthAmount = null)
443
- {
444
- $this->_preAuthAmount = $preAuthAmount;
445
- }
446
-
447
- /**
448
- * This method sets the amount
449
- * @param String $amount
450
- */
451
- public function setAmount($amount = null)
452
- {
453
- $this->_amount = $amount;
454
- }
455
-
456
- /**
457
- * Sets the currency
458
- * @param String $currency
459
- */
460
- public function setCurrency($currency = null)
461
- {
462
- $this->_currency = $currency;
463
- }
464
-
465
- /**
466
- * Sets the Customer name
467
- * @param String $name
468
- */
469
- public function setName($name = null)
470
- {
471
- $this->_name = $name;
472
- }
473
-
474
- /**
475
- * Sets the Customer Email Adress
476
- * @param String $email
477
- */
478
- public function setEmail($email = null)
479
- {
480
- $this->_email = $email;
481
- }
482
-
483
- /**
484
- * Sets the Description
485
- * @param String $description
486
- */
487
- public function setDescription($description = null)
488
- {
489
- $this->_description = $description;
490
- }
491
-
492
- /**
493
- * Sets the Api URL
494
- * @param String $apiUrl
495
- */
496
- public function setApiUrl($apiUrl = null)
497
- {
498
- $this->_apiUrl = $apiUrl;
499
- }
500
-
501
- /**
502
- * Sets the Path to the libBase
503
- * @param String $libBase Path to the Lib base. If not set, the default path is set.
504
- */
505
- public function setLibBase($libBase = null)
506
- {
507
- $this->_libBase = $libBase == null ? dirname(__FILE__) . DIRECTORY_SEPARATOR : $libBase;
508
- }
509
-
510
- /**
511
- * Sets up the Logger Object.
512
- * <b>The Logger object can be any class implementing the Services_Paymill_PaymentProcessorInterface.</b>
513
- * @param any $logger
514
- */
515
- public function setLogger(Services_Paymill_LoggingInterface $logger = null)
516
- {
517
- $this->_logger = $logger;
518
- }
519
-
520
- /**
521
- * Sets the Paymill-PrivateKey
522
- * @param string $privateKey
523
- */
524
- public function setPrivateKey($privateKey = null)
525
- {
526
- $this->_privateKey = $privateKey;
527
- }
528
-
529
- /**
530
- * Set the request source
531
- * (Modulversion_Shopname_Shopversion)
532
- * @param string $source
533
- */
534
- public function setSource($source)
535
- {
536
- $this->_source = $source;
537
- }
538
-
539
- /**
540
- * Set PreauthorizationID to be captured
541
- *
542
- * @param string $preauthId
543
- */
544
- public function setPreauthId($preauthId)
545
- {
546
- $this->_preauthId = $preauthId;
547
- }
548
-
549
  }
1
+ <?php
2
+
3
+ /**
4
+ * This class acts as an easy to use gateway for the paymill phph wrapper.
5
+ * @version 1.0.0
6
+ * @category PayIntelligent
7
+ * @copyright Copyright (c) 2013 PayIntelligent GmbH (http://payintelligent.de)
8
+ */
9
+ class Services_Paymill_PaymentProcessor
10
+ {
11
+
12
+ //Options: Variables needed to create Paymill Lib Components
13
+ private $_libBase;
14
+ private $_privateKey;
15
+ private $_apiUrl;
16
+ //Objects: Objects used by the methods
17
+ private $_transactionsObject;
18
+ private $_preauthObject;
19
+ private $_clientsObject;
20
+ private $_paymentsObject;
21
+ private $_logger; //Only this object can be set using a set function.
22
+ //Process Payment relevant
23
+ private $_token; //Token generated for the Transaction
24
+ private $_amount; //Current Amount
25
+ private $_preAuthAmount;
26
+ private $_currency; //Currency (of both amounts)
27
+ private $_name; //Customername
28
+ private $_email; //Customer Email Adress
29
+ private $_description;
30
+ private $_lastResponse;
31
+ private $_transactionId; //Transaction Id generated by the createTransaction function.
32
+ private $_preauthId;
33
+ //Fast Checkout Variables
34
+ private $_clientId = null;
35
+ private $_paymentId = null;
36
+ //Source
37
+ private $_source;
38
+
39
+ /**
40
+ * Creates an object of the PaymentProcessor class.
41
+ * @param String <b>$privateKey</b> Paymill-PrivateKey
42
+ * @param String <b>$apiUrl</b> Paymill-Api Url
43
+ * @param String <b>$libBase</b> Path to the lib Base (Can be null, Default Path will be used)
44
+ * @param array <b>$params</b>( <br />
45
+ * <b>token</b>, generated Token <br />
46
+ * <b>amount</b>, Basketamount <br />
47
+ * <b>currency</b>, Transaction currency <br />
48
+ * <b>name</b>, Customer name <br />
49
+ * <b>email</b>, Customer emailaddress <br />
50
+ * <b>description</b>, Description for transactions <br />
51
+ * ) <p color='red'><b>(If not set here, the use of setters is required for the class to work)</b></p>
52
+ * @param object $loggingClassInstance Instance of Object implementing the Services_Paymill_PaymentProcessorInterface. If not set, there will be no logging.
53
+ */
54
+ public function __construct($privateKey = null, $apiUrl = null, $libBase = null, $params = null, Services_Paymill_LoggingInterface $loggingClassInstance = null)
55
+ {
56
+ $this->setPrivateKey($privateKey);
57
+ $this->setApiUrl($apiUrl);
58
+ $this->setLibBase($libBase);
59
+ $this->_preAuthAmount = isset($params['preauthamount']) ? $params['preauthamount'] : 0;
60
+ $this->_token = $params['token'];
61
+ $this->_amount = $params['amount'];
62
+ $this->_currency = $params['currency'];
63
+ $this->_name = $params['name'];
64
+ $this->_email = $params['email'];
65
+ $this->_description = $params['description'];
66
+ $this->setLogger($loggingClassInstance);
67
+ }
68
+
69
+ /**
70
+ * Creates a Paymill-Client with the given Data
71
+ *
72
+ * @param array $params
73
+ * @return boolean
74
+ */
75
+ private function _createClient()
76
+ {
77
+ if (isset($this->_clientId)) {
78
+ $this->_log("Client using: " . $this->_clientId);
79
+ } else {
80
+ $client = $this->_clientsObject->create(
81
+ array(
82
+ 'email' => $this->_email,
83
+ 'description' => $this->_description
84
+ )
85
+ );
86
+
87
+ $this->_validateResult($client, 'Client');
88
+
89
+ $this->_clientId = $client['id'];
90
+ }
91
+ return $this->_clientId;
92
+ }
93
+
94
+ /**
95
+ * Creates a Paymill-Payment with the given Data
96
+ *
97
+ * @param array $params
98
+ * @return boolean
99
+ */
100
+ private function _createPayment()
101
+ {
102
+ if (isset($this->_paymentId)) {
103
+ $this->_log("Payment using: " . $this->_paymentId);
104
+ } else {
105
+ $payment = $this->_paymentsObject->create(
106
+ array(
107
+ 'token' => $this->_token,
108
+ 'client' => $this->_clientId
109
+ )
110
+ );
111
+ $this->_validateResult($payment, 'Payment');
112
+
113
+ $this->_paymentId = $payment['id'];
114
+ }
115
+ return true;
116
+ }
117
+
118
+ /**
119
+ * Creates a Paymill-Transaction with the given Data
120
+ *
121
+ * @param array $params
122
+ * @return boolean
123
+ */
124
+ private function _createTransaction()
125
+ {
126
+ $transaction = $this->_transactionsObject->create(
127
+ array(
128
+ 'amount' => $this->_amount,
129
+ 'currency' => $this->_currency,
130
+ 'description' => $this->_description,
131
+ 'preauthorization' => $this->_preauthId,
132
+ 'source' => $this->_source
133
+ )
134
+ );
135
+ $this->_validateResult($transaction, 'Transaction');
136
+
137
+ $this->_transactionId = $transaction['id'];
138
+ return true;
139
+ }
140
+
141
+ /**
142
+ * Creates a Paymill-Transaction with the given Data
143
+ *
144
+ * @param array $params
145
+ * @return boolean
146
+ */
147
+ private function _createPreauthorization()
148
+ {
149
+ $preAuth = $this->_preauthObject->create(
150
+ array(
151
+ 'amount' => $this->_preAuthAmount,
152
+ 'currency' => $this->_currency,
153
+ 'description' => $this->_description,
154
+ 'payment' => $this->_paymentId,
155
+ 'client' => $this->_clientId,
156
+ )
157
+ );
158
+ $this->_validateResult($preAuth, 'Preauthorization');
159
+ $this->_preauthId = $preAuth['preauthorization']['id'];
160
+ return true;
161
+ }
162
+
163
+ /**
164
+ * Load the PhpWrapper-Classes and creates an instance for each class.
165
+ */
166
+ private function _initiatePhpWrapperClasses()
167
+ {
168
+ require_once $this->_libBase . 'Transactions.php';
169
+ require_once $this->_libBase . 'Preauthorizations.php';
170
+ require_once $this->_libBase . 'Clients.php';
171
+ require_once $this->_libBase . 'Payments.php';
172
+
173
+ $this->_transactionsObject = new Services_Paymill_Transactions($this->_privateKey, $this->_apiUrl);
174
+ $this->_preauthObject = new Services_Paymill_Preauthorizations($this->_privateKey, $this->_apiUrl);
175
+ $this->_clientsObject = new Services_Paymill_Clients($this->_privateKey, $this->_apiUrl);
176
+ $this->_paymentsObject = new Services_Paymill_Payments($this->_privateKey, $this->_apiUrl);
177
+ }
178
+
179
+ /**
180
+ * Calls the log() function of the logger object if the object has been set.
181
+ *
182
+ * @param string $message
183
+ * @param string $debugInfo
184
+ */
185
+ private function _log($message, $debugInfo = null)
186
+ {
187
+ if (isset($this->_logger)) {
188
+ $this->_logger->log($message, $debugInfo);
189
+ }
190
+ }
191
+
192
+ /**
193
+ * Validates the array passed as an argument to be processPayment() compliant
194
+ * @param mixed $parameter
195
+ * @return boolean
196
+ */
197
+ private function _validateParameter()
198
+ {
199
+ if($this->_preAuthAmount == null){
200
+ $this->_preAuthAmount = $this->_amount;
201
+ }
202
+
203
+ $validation = true;
204
+ $parameter = array(
205
+ "token" => $this->_token,
206
+ "amount" => $this->_amount,
207
+ "currency" => $this->_currency,
208
+ "name" => $this->_name,
209
+ "email" => $this->_email,
210
+ "description" => $this->_description);
211
+
212
+ $arrayMask = array(
213
+ "token" => 'string',
214
+ "amount" => 'integer',
215
+ "currency" => 'string',
216
+ "name" => 'string',
217
+ "email" => 'string',
218
+ "description" => 'string');
219
+
220
+ foreach ($arrayMask as $mask => $type) {
221
+ if (is_null($parameter[$mask])) {
222
+ $validation = false;
223
+ $this->_log("The Parameter $mask is missing.", var_export($parameter, true));
224
+ } else {
225
+ switch ($type) {
226
+ case 'string':
227
+ if (!is_string($parameter[$mask])) {
228
+ $this->_log("The Parameter $mask is not a string.", var_export($parameter, true));
229
+ $validation = false;
230
+ }
231
+ break;
232
+ case 'integer':
233
+ if (!is_integer($parameter[$mask])) {
234
+ $this->_log("The Parameter $mask is not an integer.", var_export($parameter, true));
235
+ $validation = false;
236
+ }
237
+ break;
238
+ }
239
+ }
240
+
241
+ if (!$validation) {
242
+ break;
243
+ }
244
+ }
245
+ return $validation;
246
+ }
247
+
248
+ /**
249
+ * Validates the created Paymill-Objects
250
+ *
251
+ * @param array $transaction
252
+ * @param string $type
253
+ * @return boolean
254
+ */
255
+ private function _validateResult($transaction, $type)
256
+ {
257
+ $this->_lastResponse = $transaction;
258
+ if (isset($transaction['data']['response_code']) && $transaction['data']['response_code'] !== 20000) {
259
+ $this->_log("An Error occured: " . $transaction['data']['response_code'], var_export($transaction, true));
260
+ throw new Exception("Invalid Result Exception: Invalid ResponseCode");
261
+ }
262
+
263
+ if (!isset($transaction['id']) && !isset($transaction['data']['id'])) {
264
+ $this->_log("No $type created.", var_export($transaction, true));
265
+ throw new Exception("Invalid Result Exception: Invalid Id");
266
+ } else {
267
+ $this->_log("$type created.", isset($transaction['id']) ? $transaction['id'] : $transaction['data']['id']);
268
+ }
269
+
270
+ // check result
271
+ if ($type == 'Transaction') {
272
+ if (is_array($transaction) && array_key_exists('status', $transaction)) {
273
+ if ($transaction['status'] == "closed") {
274
+ // transaction was successfully issued
275
+ return true;
276
+ } elseif ($transaction['status'] == "open") {
277
+ // transaction was issued but status is open for any reason
278
+ $this->_log("Status is open.", var_export($transaction, true));
279
+ throw new Exception("Invalid Result Exception: Invalid Orderstate");
280
+ } else {
281
+ // another error occured
282
+ $this->_log("Unknown error." . var_export($transaction, true));
283
+ throw new Exception("Invalid Result Exception: Unknown Error");
284
+ }
285
+ } else {
286
+ // another error occured
287
+ $this->_log("$type could not be issued.", var_export($transaction, true));
288
+ throw new Exception("Invalid Result Exception: $type could not be issued.");
289
+ }
290
+ } else {
291
+ return true;
292
+ }
293
+ }
294
+
295
+ /**
296
+ * Executes the Payment Process
297
+ *
298
+ * @return boolean
299
+ */
300
+ final public function processPayment($captureNow = true)
301
+ {
302
+ $this->_initiatePhpWrapperClasses();
303
+ if (!$this->_validateParameter()) {
304
+ return false;
305
+ }
306
+
307
+ try {
308
+ $this->_createClient();
309
+ $this->_createPayment();
310
+ $this->_createPreauthorization();
311
+ if($captureNow){
312
+ $this->_createTransaction();
313
+ }
314
+ return true;
315
+ } catch (Exception $ex) {
316
+ // paymill wrapper threw an exception
317
+ $this->_log("Exception thrown from paymill wrapper.", $ex->getMessage());
318
+ return false;
319
+ }
320
+ }
321
+
322
+ final public function capture(){
323
+ $this->_initiatePhpWrapperClasses();
324
+ if(!isset($this->_amount) || !isset($this->_currency) || !isset($this->_preauthId)){
325
+ return false;
326
+ }
327
+ return $this->_createTransaction();
328
+ }
329
+
330
+ /**
331
+ * Returns the objects data
332
+ *
333
+ * @return array
334
+ */
335
+ public function toArray()
336
+ {
337
+ return array(
338
+ 'apiurl' => $this->_apiUrl,
339
+ 'libbase' => $this->_libBase,
340
+ 'privatekey' => $this->_privateKey,
341
+ 'logger' => $this->_logger,
342
+ 'token' => $this->_token,
343
+ 'amount' => $this->_amount,
344
+ 'preauthamount' => $this->_preAuthAmount,
345
+ 'currency' => $this->_currency,
346
+ 'description' => $this->_description,
347
+ 'email' => $this->_email,
348
+ 'name' => $this->_name,
349
+ 'source' => $this->_source
350
+ );
351
+ }
352
+
353
+ /* * **************************************************************************************************************
354
+ * *********************************************** Getter **************************************************
355
+ * *************************************************************************************************************** */
356
+
357
+ /**
358
+ * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
359
+ * Returns the ClientId
360
+ * @return String ClientId
361
+ */
362
+ public function getClientId()
363
+ {
364
+ return $this->_clientId;
365
+ }
366
+
367
+ /**
368
+ * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
369
+ * Returns the PaymentId
370
+ * @return String PaymentId
371
+ */
372
+ public function getPaymentId()
373
+ {
374
+ return $this->_paymentId;
375
+ }
376
+
377
+ /**
378
+ * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
379
+ * Returns the TransactionId
380
+ * @return String TransactionId
381
+ */
382
+ public function getTransactionId()
383
+ {
384
+ return $this->_transactionId;
385
+ }
386
+
387
+ /**
388
+ * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
389
+ * Returns the preauthId
390
+ * @return String preauthId
391
+ */
392
+ public function getPreauthId()
393
+ {
394
+ return $this->_preauthId;
395
+ }
396
+
397
+ /**
398
+ * <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
399
+ * Returns the last response send by Paymill
400
+ * @return array LastResponse
401
+ */
402
+ public function getLastResponse()
403
+ {
404
+ return $this->_lastResponse;
405
+ }
406
+
407
+ /* * **************************************************************************************************************
408
+ * *********************************************** Setter **************************************************
409
+ * *************************************************************************************************************** */
410
+
411
+ /**
412
+ * Sets the clientId
413
+ * @param String $clientId
414
+ */
415
+ public function setClientId($clientId = null)
416
+ {
417
+ $this->_clientId = $clientId;
418
+ }
419
+
420
+ /**
421
+ * Sets the paymentId
422
+ * @param String $paymentId
423
+ */
424
+ public function setPaymentId($paymentId = null)
425
+ {
426
+ $this->_paymentId = $paymentId;
427
+ }
428
+
429
+ /**
430
+ * This method sets the token
431
+ * @param String $token
432
+ */
433
+ public function setToken($token = null)
434
+ {
435
+ $this->_token = $token;
436
+ }
437
+
438
+ /**
439
+ * This method sets the preAuthAmount
440
+ * @param String $preAuthAmount
441
+ */
442
+ public function setPreAuthAmount($preAuthAmount = null)
443
+ {
444
+ $this->_preAuthAmount = $preAuthAmount;
445
+ }
446
+
447
+ /**
448
+ * This method sets the amount
449
+ * @param String $amount
450
+ */
451
+ public function setAmount($amount = null)
452
+ {
453
+ $this->_amount = $amount;
454
+ }
455
+
456
+ /**
457
+ * Sets the currency
458
+ * @param String $currency
459
+ */
460
+ public function setCurrency($currency = null)
461
+ {
462
+ $this->_currency = $currency;
463
+ }
464
+
465
+ /**
466
+ * Sets the Customer name
467
+ * @param String $name
468
+ */
469
+ public function setName($name = null)
470
+ {
471
+ $this->_name = $name;
472
+ }
473
+
474
+ /**
475
+ * Sets the Customer Email Adress
476
+ * @param String $email
477
+ */
478
+ public function setEmail($email = null)
479
+ {
480
+ $this->_email = $email;
481
+ }
482
+
483
+ /**
484
+ * Sets the Description
485
+ * @param String $description
486
+ */
487
+ public function setDescription($description = null)
488
+ {
489
+ $this->_description = $description;
490
+ }
491
+
492
+ /**
493
+ * Sets the Api URL
494
+ * @param String $apiUrl
495
+ */
496
+ public function setApiUrl($apiUrl = null)
497
+ {
498
+ $this->_apiUrl = $apiUrl;
499
+ }
500
+
501
+ /**
502
+ * Sets the Path to the libBase
503
+ * @param String $libBase Path to the Lib base. If not set, the default path is set.
504
+ */
505
+ public function setLibBase($libBase = null)
506
+ {
507
+ $this->_libBase = $libBase == null ? dirname(__FILE__) . DIRECTORY_SEPARATOR : $libBase;
508
+ }
509
+
510
+ /**
511
+ * Sets up the Logger Object.
512
+ * <b>The Logger object can be any class implementing the Services_Paymill_PaymentProcessorInterface.</b>
513
+ * @param any $logger
514
+ */
515
+ public function setLogger(Services_Paymill_LoggingInterface $logger = null)
516
+ {
517
+ $this->_logger = $logger;
518
+ }
519
+
520
+ /**
521
+ * Sets the Paymill-PrivateKey
522
+ * @param string $privateKey
523
+ */
524
+ public function setPrivateKey($privateKey = null)
525
+ {
526
+ $this->_privateKey = $privateKey;
527
+ }
528
+
529
+ /**
530
+ * Set the request source
531
+ * (Modulversion_Shopname_Shopversion)
532
+ * @param string $source
533
+ */
534
+ public function setSource($source)
535
+ {
536
+ $this->_source = $source;
537
+ }
538
+
539
+ /**
540
+ * Set PreauthorizationID to be captured
541
+ *
542
+ * @param string $preauthId
543
+ */
544
+ public function setPreauthId($preauthId)
545
+ {
546
+ $this->_preauthId = $preauthId;
547
+ }
548
+
549
  }
lib/Services/Paymill/Payments.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for payments resource
7
- */
8
- class Services_Paymill_Payments extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'payments/';
14
-
15
- /**
16
- * General REST PUT verb
17
- * Update resource item
18
- *
19
- * @param array $itemData
20
- *
21
- * @return array item updated or null
22
- */
23
- public function update(array $itemData = array())
24
- {
25
- throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
26
- }
27
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for payments resource
7
+ */
8
+ class Services_Paymill_Payments extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'payments/';
14
+
15
+ /**
16
+ * General REST PUT verb
17
+ * Update resource item
18
+ *
19
+ * @param array $itemData
20
+ *
21
+ * @return array item updated or null
22
+ */
23
+ public function update(array $itemData = array())
24
+ {
25
+ throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
26
+ }
27
  }
lib/Services/Paymill/Preauthorizations.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for transactions resource
7
- */
8
- class Services_Paymill_Preauthorizations extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'preauthorizations/';
14
-
15
- /**
16
- * General REST PUT verb
17
- * Update resource item
18
- *
19
- * @param array $itemData
20
- *
21
- * @return array item updated or null
22
- */
23
- public function update(array $itemData = array())
24
- {
25
- throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
26
- }
27
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for transactions resource
7
+ */
8
+ class Services_Paymill_Preauthorizations extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'preauthorizations/';
14
+
15
+ /**
16
+ * General REST PUT verb
17
+ * Update resource item
18
+ *
19
+ * @param array $itemData
20
+ *
21
+ * @return array item updated or null
22
+ */
23
+ public function update(array $itemData = array())
24
+ {
25
+ throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
26
+ }
27
  }
lib/Services/Paymill/Refunds.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for refunds resource
7
- */
8
- class Services_Paymill_Refunds extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'refunds/';
14
-
15
- /**
16
- * General REST POST verb
17
- * create resource item
18
- *
19
- * @param array $itemData
20
- *
21
- * @return array created item
22
- */
23
- public function create($itemData = array())
24
- {
25
- $transactionId = $itemData['transactionId'];
26
- $params = $itemData['params'];
27
-
28
- $result = $this->_httpClient->request(
29
- $this->_serviceResource . "$transactionId",
30
- $params,
31
- Services_Paymill_Apiclient_Interface::HTTP_POST
32
- );
33
- return $result['data'];
34
- }
35
-
36
- /**
37
- * General REST DELETE verb
38
- * Delete or inactivate/cancel resource item
39
- *
40
- * @param string $clientId
41
- *
42
- * @return array item deleted
43
- */
44
- public function delete($identifier = null)
45
- {
46
- throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
47
- }
48
-
49
- /**
50
- * {@inheritDoc}
51
- */
52
- public function update(array $itemData = array())
53
- {
54
- throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404" );
55
- }
56
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for refunds resource
7
+ */
8
+ class Services_Paymill_Refunds extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'refunds/';
14
+
15
+ /**
16
+ * General REST POST verb
17
+ * create resource item
18
+ *
19
+ * @param array $itemData
20
+ *
21
+ * @return array created item
22
+ */
23
+ public function create($itemData = array())
24
+ {
25
+ $transactionId = $itemData['transactionId'];
26
+ $params = $itemData['params'];
27
+
28
+ $result = $this->_httpClient->request(
29
+ $this->_serviceResource . "$transactionId",
30
+ $params,
31
+ Services_Paymill_Apiclient_Interface::HTTP_POST
32
+ );
33
+ return $result['data'];
34
+ }
35
+
36
+ /**
37
+ * General REST DELETE verb
38
+ * Delete or inactivate/cancel resource item
39
+ *
40
+ * @param string $clientId
41
+ *
42
+ * @return array item deleted
43
+ */
44
+ public function delete($identifier = null)
45
+ {
46
+ throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
47
+ }
48
+
49
+ /**
50
+ * {@inheritDoc}
51
+ */
52
+ public function update(array $itemData = array())
53
+ {
54
+ throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404" );
55
+ }
56
  }
lib/Services/Paymill/Subscriptions.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for subscriptions resource
7
- */
8
- class Services_Paymill_Subscriptions extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'subscriptions/';
14
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for subscriptions resource
7
+ */
8
+ class Services_Paymill_Subscriptions extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'subscriptions/';
14
  }
lib/Services/Paymill/Transactions.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for transactions resource
7
- */
8
- class Services_Paymill_Transactions extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'transactions/';
14
-
15
- /**
16
- * General REST PUT verb
17
- * Update resource item
18
- *
19
- * @param array $itemData
20
- *
21
- * @return array item updated or null
22
- */
23
- public function update(array $itemData = array())
24
- {
25
- throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
26
- }
27
-
28
- /**
29
- * General REST DELETE verb
30
- * Delete or inactivate/cancel resource item
31
- *
32
- * @param string $clientId
33
- *
34
- * @return array item deleted
35
- */
36
- public function delete($clientId = null)
37
- {
38
- throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
39
- }
40
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for transactions resource
7
+ */
8
+ class Services_Paymill_Transactions extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'transactions/';
14
+
15
+ /**
16
+ * General REST PUT verb
17
+ * Update resource item
18
+ *
19
+ * @param array $itemData
20
+ *
21
+ * @return array item updated or null
22
+ */
23
+ public function update(array $itemData = array())
24
+ {
25
+ throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
26
+ }
27
+
28
+ /**
29
+ * General REST DELETE verb
30
+ * Delete or inactivate/cancel resource item
31
+ *
32
+ * @param string $clientId
33
+ *
34
+ * @return array item deleted
35
+ */
36
+ public function delete($clientId = null)
37
+ {
38
+ throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
39
+ }
40
  }
lib/Services/Paymill/Webhooks.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
-
3
- require_once ('Base.php');
4
-
5
- /**
6
- * Paymill API wrapper for webhooks resource
7
- */
8
- class Services_Paymill_Webhooks extends Services_Paymill_Base
9
- {
10
- /**
11
- * {@inheritDoc}
12
- */
13
- protected $_serviceResource = 'webhooks/';
14
  }
1
+ <?php
2
+
3
+ require_once ('Base.php');
4
+
5
+ /**
6
+ * Paymill API wrapper for webhooks resource
7
+ */
8
+ class Services_Paymill_Webhooks extends Services_Paymill_Base
9
+ {
10
+ /**
11
+ * {@inheritDoc}
12
+ */
13
+ protected $_serviceResource = 'webhooks/';
14
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Paymill_Paymill</name>
4
- <version>3.0.6</version>
5
  <stability>stable</stability>
6
  <license>Open Software License</license>
7
  <channel>community</channel>
@@ -13,17 +13,12 @@ The Paymill Magento extension provides a credit card form and a direct debit for
13
  &lt;br /&gt;&lt;br /&gt;&#xD;
14
  IMPORTANT: Only use the latest version.&#xD;
15
  </description>
16
- <notes>* Rewrote from scratch&#xD;
17
- * Updated Lib to latest version&#xD;
18
- * Redesigned credit card payment form&#xD;
19
- * Several minor bug fixes&#xD;
20
- * Fixed a bug causing the plugin to crash during invoice creation&#xD;
21
- * Payment Methods will now only be displayed if the Keys are set in the config.&#xD;
22
- * Fixed a bug causing warnings in the Magento Systemlog in multiple cases</notes>
23
  <authors><author><name>PayIntelligent</name><user>Paymill</user><email>community@paymill.de</email></author></authors>
24
- <date>2013-08-12</date>
25
- <time>08:38:15</time>
26
- <contents><target name="magecommunity"><dir><dir name="Paymill"><dir name="Paymill"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="a072de29acb8c020366d94b127368fd2"/></dir><file name="Log.php" hash="1876dc72d3ea2af71cf11b78a1433090"/></dir><dir name="Payment"><dir name="Form"><file name="PaymentFormCreditcard.php" hash="47b33902693d6ad04099235507692d86"/><file name="PaymentFormDirectdebit.php" hash="1b15c365ac781a823977e4e78bdd1ad4"/></dir><dir name="Info"><file name="PaymentFormCreditcard.php" hash="ecd6af705b2f7fe793366231aa60109f"/><file name="PaymentFormDirectdebit.php" hash="24dbeb75e07650a952783c98fb54ffc7"/></dir></dir></dir><dir name="Helper"><file name="CustomerHelper.php" hash="baa44a3c09c3fe8000e0d3a854edcf3c"/><file name="Data.php" hash="244d329a530a90ad6183e0f2901442f6"/><file name="FastCheckoutHelper.php" hash="2a53baf4ae5fe79ba17e55ad0fd58197"/><file name="LoggingHelper.php" hash="69b6bbc137bdf4c00cd68dcbb6c1e745"/><file name="OptionHelper.php" hash="21d2931511b0eb6afe4f094785e6259a"/><file name="PaymentHelper.php" hash="641f1e0dfad92c3756d07673fc8ac9d2"/><file name="RefundHelper.php" hash="4ef32cb3359876ad0b0a1a3b5b90929e"/><file name="TransactionHelper.php" hash="03767c497742c07bea7c7474d71711d0"/></dir><dir name="Model"><file name="Fastcheckout.php" hash="73f98e9f714ca3852345d083fe61886b"/><file name="Log.php" hash="3fad24d6a59944e532d84b3da4e0deec"/><dir name="Method"><file name="MethodModelAbstract.php" hash="1b94d8a72891e09561161f092fdce4d4"/><file name="MethodModelCreditcard.php" hash="9d3a411d46dedd668262e839f5381bfa"/><file name="MethodModelDirectdebit.php" hash="b2b48a08b55e1b197f644be542f6e4dc"/></dir><dir name="Mysql4"><dir name="Fastcheckout"><file name="Collection.php" hash="12d097172603664ba709c172b58a93e7"/></dir><file name="Fastcheckout.php" hash="14c502c4d34233dc28608ade742ab714"/><dir name="Log"><file name="Collection.php" hash="c5b02070b09412822a839b3cbb0eba4e"/></dir><file name="Log.php" hash="aa7ffaa88fec8df550926e974c15baa0"/></dir><file name="Observer.php" hash="66fc31850592ec7cc01357721a7e0080"/><file name="TransactionData.php" hash="6ee635f10a61be28fd9e4a2fff84ff07"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LogController.php" hash="6c29c403416a13150e76e400a2437157"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="383052bdb4651dacf1373a27349259fd"/><file name="config.xml" hash="b3f3ee438eb62c6b3ae827254b21cf41"/><file name="system.xml" hash="23659381a9241d65ade793d79f735c7f"/></dir><dir name="sql"><dir name="paymill_setup"><file name="mysql4-install-3.0.0.php" hash="cb5c381203c39066849fa301e6dfc70f"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="paymill.xml" hash="77d6d4e07a61ba76c8842249d267f62d"/></dir><dir name="template"><dir name="paymill"><dir name="payment"><dir name="info"><file name="creditcard.phtml" hash="6cd22661b0299e918c17a1f53ad7d6e3"/><file name="directdebit.phtml" hash="6cd22661b0299e918c17a1f53ad7d6e3"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="paymill.xml" hash="a93d3b26d40c793f10b51ba8f5bea27d"/></dir><dir name="template"><dir name="paymill"><dir name="payment"><dir name="form"><file name="creditcard.phtml" hash="a8e42f2b62e752d8ae3cf010228abe78"/><file name="directdebit.phtml" hash="2234a3ca4cbd76f6cff0396ddfae96f0"/></dir><dir name="info"><file name="creditcard.phtml" hash="f8172621f496767cba1aa5ee9a17f241"/><file name="directdebit.phtml" hash="f8172621f496767cba1aa5ee9a17f241"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Paymill_Paymill.xml" hash="87f99b47f25b708a6aa8f94507bc91db"/></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Paymill_Paymill.csv" hash="2bd3abdd228ca04bf94e25cd4644f6cc"/></dir><dir name="en_GB"><file name="Paymill_Paymill.csv" hash="56724674005626dbbc17f25917476f6f"/></dir><dir name="en_US"><file name="Paymill_Paymill.csv" hash="56724674005626dbbc17f25917476f6f"/></dir></dir></target><target name="mageweb"><dir><dir name="js"><dir name="paymill"><file name="paymentForm.js" hash="a893716ff9ef8d83f54e343fd896059b"/></dir></dir></dir></target><target name="magelib"><dir><dir name="Services"><dir name="Paymill"><dir name="Apiclient"><file name="Curl.php" hash="be417f59f4500ac3821459f1d4adb073"/><file name="Interface.php" hash="db5fb584ce410ff55b71419624f6d7db"/><file name="paymill.crt" hash="f85d1ff17b0079709f131f3ce3f288d2"/></dir><file name="Base.php" hash="371fbb92b604876ef9f4cdde503d8360"/><file name="Clients.php" hash="55eecee28daf6f00e803dfec1e31156c"/><file name="Exception.php" hash="21dc05247ea04d8ced72c2ee39a4d602"/><file name="LoggingInterface.php" hash="7f425749d7fab561c9826c3984fed9dc"/><file name="Offers.php" hash="07f219489dc347c432530cdc927d720a"/><file name="PaymentProcessor.php" hash="0bc9c5e444630188c4e5a6085feb9266"/><file name="Payments.php" hash="01d376af043989b363155d2dd94a808d"/><file name="Preauthorizations.php" hash="62dda9a5ee853e9c53d0c40fae7e95bd"/><file name="Refunds.php" hash="2b1599f36acb269fce94693b8ab172f8"/><file name="Subscriptions.php" hash="ddc58cc1e045a2ca7831f84886db4fbf"/><file name="Transactions.php" hash="f61bb42d8bf51b397574bb2c7d66e5e2"/><file name="Webhooks.php" hash="0d47a80f04565970179d5543685ca1aa"/></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="paymill"><file name="logo.css" hash="9bd7e954725c6de30bbc2e9f99262c52"/></dir></dir><dir name="images"><dir name="paymill"><file name="icon_32x20_amex.png" hash="42c5fb43b4b603804b50da9761927d40"/><file name="icon_32x20_dinersclub.png" hash="0a7a8fc8f679ccf05d91298c9968629c"/><file name="icon_32x20_discover.png" hash="4fe8ef419087bed97cddbdeb251b847c"/><file name="icon_32x20_jcb.png" hash="774a040f938c5566fa3fddfa840d4743"/><file name="icon_32x20_maestro.png" hash="a6ffd22c9bbedb603449e2aa6136dbd1"/><file name="icon_32x20_mastercard.png" hash="09aef6dcbc50038605b7c0e5a38eb76e"/><file name="icon_32x20_visa.png" hash="e6d54e5c0120202eb5757bcfe499d73b"/><file name="icon_paymill.png" hash="303983a288b45cc7ddc5b88ad2eedd51"/></dir></dir></dir></dir></dir></dir></target></contents>
27
  <compatible/>
28
- <dependencies><required><php><min>5.3.0</min><max>6.0.0.</max></php></required></dependencies>
29
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Paymill_Paymill</name>
4
+ <version>3.1.0</version>
5
  <stability>stable</stability>
6
  <license>Open Software License</license>
7
  <channel>community</channel>
13
  &lt;br /&gt;&lt;br /&gt;&#xD;
14
  IMPORTANT: Only use the latest version.&#xD;
15
  </description>
16
+ <notes>* ensure that a token exist&#xD;
17
+ * payment form styling</notes>
 
 
 
 
 
18
  <authors><author><name>PayIntelligent</name><user>Paymill</user><email>community@paymill.de</email></author></authors>
19
+ <date>2013-09-24</date>
20
+ <time>12:21:10</time>
21
+ <contents><target name="magecommunity"><dir><dir name="Paymill"><dir name="Paymill"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="c391d53272be7fcdface2946949256a6"/></dir><file name="Log.php" hash="02930fb46a2a4569176ceb29c45037e8"/></dir><dir name="Payment"><dir name="Form"><file name="PaymentFormCreditcard.php" hash="c699219946c8f4b3925d62629da9790a"/><file name="PaymentFormDirectdebit.php" hash="e5958d8aee1777dfce4ba08308b3fa6e"/></dir><dir name="Info"><file name="PaymentFormCreditcard.php" hash="3e7a3d2b84878bc22f6ac9e2a0ac5c76"/><file name="PaymentFormDirectdebit.php" hash="bbc8f0cae5dff57df9ec1975650fe5e0"/></dir></dir></dir><dir name="Helper"><file name="CustomerHelper.php" hash="2970725a233e835e8c24d47d6a650c6a"/><file name="Data.php" hash="48b84dc87bc37a077b595812b95bfc2f"/><file name="FastCheckoutHelper.php" hash="7c3c8af30080ec99e8ff4154409b4135"/><file name="LoggingHelper.php" hash="53ea7f4d5c3af8de149a06dbe37ac061"/><file name="OptionHelper.php" hash="c80b6d673e5f0889062e1978d9fce599"/><file name="PaymentHelper.php" hash="677d90ce786a140f418099cf00557dde"/><file name="RefundHelper.php" hash="b936d48e6f9022acb0370ec755cf5850"/><file name="TransactionHelper.php" hash="7cce355230eee2f1c617df1bd18f8752"/></dir><dir name="Model"><file name="Fastcheckout.php" hash="94565a600a12f880edeabc941bd35ded"/><file name="Log.php" hash="476c497495b92c3cf49e0c7b470854d4"/><dir name="Method"><file name="MethodModelAbstract.php" hash="5df552abf962ab1b7db99e24269b5e2c"/><file name="MethodModelCreditcard.php" hash="03a6926e8a56f994196268e313697e6e"/><file name="MethodModelDirectdebit.php" hash="bc7bc9b40760ca488e48a257dccc768d"/></dir><dir name="Mysql4"><dir name="Fastcheckout"><file name="Collection.php" hash="14d4aa413ec952fd2452f08ab2a208f6"/></dir><file name="Fastcheckout.php" hash="56b09daa390ba1f4f5116f1d701833e4"/><dir name="Log"><file name="Collection.php" hash="cf4d8fec68a4cc44b2e47bf69e014cf3"/></dir><file name="Log.php" hash="9bd80dc9300cc189b6b3ebd921b4e3e6"/></dir><file name="Observer.php" hash="1f4a97d901810157228fd9224f319827"/><file name="TransactionData.php" hash="6f2bfd7a7ecde8dc4f21e03d33fdd7e4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LogController.php" hash="66f680f85a31fa40164dea952acf0e68"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="402c36431d690ffa9b7eae074cadfb4e"/><file name="config.xml" hash="b1fb38f44fec083ae8583f80b32592d4"/><file name="system.xml" hash="6322dd7b90ef6baf598193ccf93d2eb9"/></dir><dir name="sql"><dir name="paymill_setup"><file name="mysql4-install-3.0.0.php" hash="c092db5064c8a204fdbbb01f2bba3974"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="paymill.xml" hash="fcc95f6e7c375fee779178a0f9f1a1d8"/></dir><dir name="template"><dir name="paymill"><dir name="payment"><dir name="info"><file name="creditcard.phtml" hash="1c604ec666d9a3028a04c0d9a4257e4a"/><file name="directdebit.phtml" hash="1c604ec666d9a3028a04c0d9a4257e4a"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="paymill.xml" hash="a93d3b26d40c793f10b51ba8f5bea27d"/></dir><dir name="template"><dir name="paymill"><dir name="payment"><dir name="form"><file name="creditcard.phtml" hash="b5a100620772a2fd9fc98c2cce479180"/><file name="directdebit.phtml" hash="d78f8090a4115e1fa879b0f7e506f60c"/></dir><dir name="info"><file name="creditcard.phtml" hash="42f875eb1b6e3e6151ddf152ef0bf13a"/><file name="directdebit.phtml" hash="42f875eb1b6e3e6151ddf152ef0bf13a"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Paymill_Paymill.xml" hash="d36d3af5f5752dcf87517272ddb9af53"/></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Paymill_Paymill.csv" hash="eec8ff8295f324789bded24ede85e80e"/></dir><dir name="en_GB"><file name="Paymill_Paymill.csv" hash="bd30eacaf4d47b5c98d961f301842a82"/></dir><dir name="en_US"><file name="Paymill_Paymill.csv" hash="3d003ce9bd872c634b581b894cfe7279"/></dir></dir></target><target name="mageweb"><dir><dir name="js"><dir name="paymill"><file name="paymentForm.js" hash="59ea8db344b49e9e4f69e7d3d91dab43"/></dir></dir></dir></target><target name="magelib"><dir><dir name="Services"><dir name="Paymill"><dir name="Apiclient"><file name="Curl.php" hash="62457ead798a8bf62ccddb0bc7e8f449"/><file name="Interface.php" hash="349309458455e550c562fb17cf23f4a6"/><file name="paymill.crt" hash="51e14b4c734e450402ea2cf73f2aee0f"/></dir><file name="Base.php" hash="9f583d1613257b20a7d325131d545fae"/><file name="Clients.php" hash="f9bc9034a6f3b88a842f35efd6524ab6"/><file name="Exception.php" hash="9beffb75d92c0de3c1c7ea5b33930fff"/><file name="LoggingInterface.php" hash="46ebeede1da14b761c54a18aff6c3b79"/><file name="Offers.php" hash="28b2d420c87531ffa1f193ec3934fc5b"/><file name="PaymentProcessor.php" hash="2ba66701b6f405ccdb218a9b320458f0"/><file name="Payments.php" hash="dd8e18548fb149956fff93fd55f68029"/><file name="Preauthorizations.php" hash="af4c8ab19444eee76951e9fe9f0e8fdd"/><file name="Refunds.php" hash="e15a2dfb3df362cb9cd45c8e5382b77b"/><file name="Subscriptions.php" hash="e8f55fcfd1065439d49bc5f734294be6"/><file name="Transactions.php" hash="fb6d248c88285105a426bf4491cbfc6b"/><file name="Webhooks.php" hash="06be5e57b81b3052a56371933e0674e9"/></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="paymill"><file name="logo.css" hash="7000c544325686518772af11130e5b23"/></dir></dir><dir name="images"><dir name="paymill"><file name="icon_32x20_amex.png" hash="42c5fb43b4b603804b50da9761927d40"/><file name="icon_32x20_dinersclub.png" hash="0a7a8fc8f679ccf05d91298c9968629c"/><file name="icon_32x20_discover.png" hash="4fe8ef419087bed97cddbdeb251b847c"/><file name="icon_32x20_jcb.png" hash="774a040f938c5566fa3fddfa840d4743"/><file name="icon_32x20_maestro.png" hash="a6ffd22c9bbedb603449e2aa6136dbd1"/><file name="icon_32x20_mastercard.png" hash="09aef6dcbc50038605b7c0e5a38eb76e"/><file name="icon_32x20_visa.png" hash="e6d54e5c0120202eb5757bcfe499d73b"/><file name="icon_paymill.png" hash="303983a288b45cc7ddc5b88ad2eedd51"/></dir></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0.</max></php></required></dependencies>
24
  </package>
skin/frontend/base/default/css/paymill/logo.css CHANGED
@@ -1,17 +1,17 @@
1
- .paymill_powered {
2
- border: 1px solid #ccc;
3
- width: 350px;
4
- padding: 4px;
5
- background: white url('../../images/paymill/icon_paymill.png') no-repeat center right;
6
- -moz-border-radius: 3px;
7
- border-radius: 3px;
8
- margin-top: 10px;
9
- }
10
- .paymill_powered > .paymill_credits {
11
- width: 160px;
12
- color: #666;
13
- }
14
- .paymill_powered > a {
15
- color: #666;
16
- text-decoration: underline;
17
  }
1
+ .paymill_powered {
2
+ border: 1px solid #ccc;
3
+ width: 350px;
4
+ padding: 4px;
5
+ background: white url('../../images/paymill/icon_paymill.png') no-repeat center right;
6
+ -moz-border-radius: 3px;
7
+ border-radius: 3px;
8
+ margin-top: 10px;
9
+ }
10
+ .paymill_powered > .paymill_credits {
11
+ width: 160px;
12
+ color: #666;
13
+ }
14
+ .paymill_powered > a {
15
+ color: #666;
16
+ text-decoration: underline;
17
  }