Mage_Payone - Version 3.6.1

Version Notes

Mage_Payone-3.6.1

Download this release

Release Info

Developer PAYONE
Extension Mage_Payone
Version 3.6.1
Comparing to
See all releases


Code changes from version 3.5.5 to 3.6.1

Files changed (67) hide show
  1. app/code/community/Payone/Core/Block/Adminhtml/System/Config/Form/Field/RatePayStoreIds.php +9 -5
  2. app/code/community/Payone/Core/Block/Payment/Method/Form/DebitPayment.php +11 -0
  3. app/code/community/Payone/Core/Block/Payment/Method/Form/Financing.php +0 -96
  4. app/code/community/Payone/Core/Block/Payment/Method/Form/Financing/Klarna.php +0 -300
  5. app/code/community/Payone/Core/Block/Payment/Method/Form/OnlineBankTransfer.php +10 -0
  6. app/code/community/Payone/Core/Block/Payment/Method/Info/Financing.php +0 -52
  7. app/code/community/Payone/Core/Model/Config/General/StatusMapping.php +29 -0
  8. app/code/community/Payone/Core/Model/Config/Payment/Method.php +42 -0
  9. app/code/community/Payone/Core/Model/Config/Payment/Method/Interface.php +20 -0
  10. app/code/community/Payone/Core/Model/Factory.php +0 -9
  11. app/code/community/Payone/Core/Model/Handler/Payment/Abstract.php +0 -4
  12. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Authorize/Abstract.php +15 -50
  13. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Debit.php +2 -2
  14. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Genericpayment.php +2 -2
  15. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/BankAccountCheck.php +4 -2
  16. app/code/community/Payone/Core/Model/Observer/Sales/Order.php +1 -1
  17. app/code/community/Payone/Core/Model/Payment/Method/Abstract.php +0 -1
  18. app/code/community/Payone/Core/Model/Payment/Method/Financing.php +0 -86
  19. app/code/community/Payone/Core/Model/Repository/Api.php +1 -1
  20. app/code/community/Payone/Core/Model/Sales/Quote/Address/Total/Fee.php +7 -5
  21. app/code/community/Payone/Core/Model/Service/Config/XmlGenerate.php +4 -29
  22. app/code/community/Payone/Core/Model/System/Config/AuthorizeMethodFinancing.php +0 -46
  23. app/code/community/Payone/Core/Model/System/Config/ClearingType.php +9 -0
  24. app/code/community/Payone/Core/Model/System/Config/FinancingType.php +0 -56
  25. app/code/community/Payone/Core/Model/System/Config/MethodType.php +0 -4
  26. app/code/community/Payone/Core/Model/System/Config/PaymentMethodCode.php +0 -2
  27. app/code/community/Payone/Core/Model/System/Config/PaymentMethodType.php +0 -2
  28. app/code/community/Payone/Core/controllers/Adminhtml/Payonecore/System/ConfigurationController.php +107 -105
  29. app/code/community/Payone/Core/etc/config.xml +14 -15
  30. app/code/community/Payone/Core/etc/system.xml +45 -74
  31. app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.5.10-3.6.0.php +59 -0
  32. app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.5.6-3.5.7.php +87 -0
  33. app/code/community/Payone/Core/sql/payone_core_setup/upgrade-3.5.10-3.6.0.sql +6 -0
  34. app/code/community/Payone/Core/sql/payone_core_setup/upgrade-3.5.6-3.5.7.sql +29 -0
  35. app/code/community/Payone/Licensemanager/Block/Adminhtml/Notification/Toolbar.php +1 -2
  36. app/code/community/Payone/Licensemanager/Block/Adminhtml/Notification/Window.php +1 -2
  37. app/code/community/Payone/Licensemanager/controllers/{ActiveController.php → Adminhtml/Payonelicensemanager/ActiveController.php} +1 -1
  38. app/code/community/Payone/Licensemanager/etc/config.xml +1 -1
  39. app/code/community/Payone/Migrator/Helper/Data.php +2 -0
  40. app/code/community/Payone/Migrator/Model/Mapper/Config/Payment.php +4 -0
  41. app/design/adminhtml/default/default/template/payone/core/payment/method/form/payolution.phtml +6 -6
  42. app/design/adminhtml/default/default/template/payone/core/payment/method/info/financing.phtml +0 -35
  43. app/design/adminhtml/default/default/template/payone/core/payment/method/info/payolution.phtml +45 -0
  44. app/design/adminhtml/default/default/template/payone/core/payment/method/info/ratepay.phtml +45 -0
  45. app/design/adminhtml/default/default/template/payone/core/system/config/form/field/ratepay_shopids.phtml +7 -3
  46. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/financing.phtml +0 -32
  47. app/design/frontend/base/default/layout/payone/core.xml +0 -1
  48. app/design/frontend/base/default/template/payone/core/payment/method/form/debitpayment.phtml +17 -15
  49. app/design/frontend/base/default/template/payone/core/payment/method/form/financing.phtml +0 -79
  50. app/design/frontend/base/default/template/payone/core/payment/method/form/financing/klarna.phtml +0 -173
  51. app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfer.phtml +2 -0
  52. app/design/frontend/base/default/template/payone/core/payment/method/form/payolution.phtml +5 -5
  53. app/design/frontend/base/default/template/payone/core/payment/method/info/financing.phtml +0 -36
  54. app/locale/de_DE/Payone_Core.csv +3 -17
  55. js/payone/core/debitpayment.js +9 -8
  56. js/payone/core/financing.js +0 -46
  57. js/payone/core/onlinebanktransfer.js +7 -2
  58. lib/Payone/Api/Response/Abstract.php +14 -3
  59. lib/Payone/Api/Response/Genericpayment/Approved.php +0 -2
  60. lib/Payone/Enum/ClearingType.php +2 -2
  61. lib/Payone/Settings/Configuration/PaymentMethod.php +5 -4
  62. lib/Payone/Settings/Data/ConfigFile/Global/StatusMapping.php +7 -3
  63. lib/Payone/Settings/Data/ConfigFile/PaymentMethod/Financing.php +1 -0
  64. lib/Payone/Settings/Data/ConfigFile/PaymentMethod/Payolution.php +38 -0
  65. lib/Payone/Settings/Data/ConfigFile/PaymentMethod/{RatePay.php → Ratepay.php} +1 -1
  66. lib/Payone/Settings/Service/XmlGenerate.php +0 -25
  67. package.xml +5 -5
app/code/community/Payone/Core/Block/Adminhtml/System/Config/Form/Field/RatePayStoreIds.php CHANGED
@@ -37,7 +37,11 @@ class Payone_Core_Block_Adminhtml_System_Config_Form_Field_RatePayStoreIds
37
{
38
$this->addColumn('ratepay_shopid', array(
39
'label' => Mage::helper('payone_core')->__('Shop-ID'),
40
- 'style' => 'min-width:120px;',
41
));
42
$this->_addAfter = false;
43
$this->_addButtonLabel = Mage::helper('payone_core')->__('Add Shop-ID');
@@ -51,13 +55,13 @@ class Payone_Core_Block_Adminhtml_System_Config_Form_Field_RatePayStoreIds
51
return $this->_oRatePay;
52
}
53
54
- protected function _requestRatePayConfigFromApi($sRatePayShopId) {
55
$sMethodId = $this->getRequest()->get('id');
56
$oConfigHelper = $this->getFactory()->helperConfig();
57
$oConfig = $oConfigHelper->getConfigPaymentMethodById($sMethodId);
58
$oService = $this->getFactory()->getServicePaymentGenericpayment($oConfig);
59
$oMapper = $oService->getMapper();
60
- $oRequest = $oMapper->addRatePayParameters($sRatePayShopId);
61
$oResponse = $this->getFactory()->getServiceApiPaymentGenericpayment()->request($oRequest);
62
63
if($oResponse instanceof Payone_Api_Response_Genericpayment_Ok) {
@@ -71,12 +75,12 @@ class Payone_Core_Block_Adminhtml_System_Config_Form_Field_RatePayStoreIds
71
return false;
72
}
73
74
- public function getRatePayShopConfig($sRatePayShopId) {
75
$sRatePayShopId = trim($sRatePayShopId);
76
$oRatePay = $this->_getRatePayObject();
77
$aRatePayConfig = $oRatePay->getRatePayConfigById($sRatePayShopId);
78
if(!$aRatePayConfig) {
79
- $aRatePayConfig = $this->_requestRatePayConfigFromApi($sRatePayShopId);
80
}
81
return $aRatePayConfig;
82
}
37
{
38
$this->addColumn('ratepay_shopid', array(
39
'label' => Mage::helper('payone_core')->__('Shop-ID'),
40
+ 'style' => 'width:60px;',
41
+ ));
42
+ $this->addColumn('ratepay_currency', array(
43
+ 'label' => Mage::helper('payone_core')->__('Currency'),
44
+ 'style' => 'width:60px;',
45
));
46
$this->_addAfter = false;
47
$this->_addButtonLabel = Mage::helper('payone_core')->__('Add Shop-ID');
55
return $this->_oRatePay;
56
}
57
58
+ protected function _requestRatePayConfigFromApi($sRatePayShopId, $sCurrency) {
59
$sMethodId = $this->getRequest()->get('id');
60
$oConfigHelper = $this->getFactory()->helperConfig();
61
$oConfig = $oConfigHelper->getConfigPaymentMethodById($sMethodId);
62
$oService = $this->getFactory()->getServicePaymentGenericpayment($oConfig);
63
$oMapper = $oService->getMapper();
64
+ $oRequest = $oMapper->addRatePayParameters($sRatePayShopId, $sCurrency);
65
$oResponse = $this->getFactory()->getServiceApiPaymentGenericpayment()->request($oRequest);
66
67
if($oResponse instanceof Payone_Api_Response_Genericpayment_Ok) {
75
return false;
76
}
77
78
+ public function getRatePayShopConfig($sRatePayShopId, $sCurrency) {
79
$sRatePayShopId = trim($sRatePayShopId);
80
$oRatePay = $this->_getRatePayObject();
81
$aRatePayConfig = $oRatePay->getRatePayConfigById($sRatePayShopId);
82
if(!$aRatePayConfig) {
83
+ $aRatePayConfig = $this->_requestRatePayConfigFromApi($sRatePayShopId, $sCurrency);
84
}
85
return $aRatePayConfig;
86
}
app/code/community/Payone/Core/Block/Payment/Method/Form/DebitPayment.php CHANGED
@@ -88,4 +88,15 @@ class Payone_Core_Block_Payment_Method_Form_DebitPayment
88
89
return $resultArr;
90
}
91
}
88
89
return $resultArr;
90
}
91
+
92
+ /**
93
+ * Return if bic input has to be shown
94
+ *
95
+ * @return bool
96
+ */
97
+ public function getSepaRequestBic()
98
+ {
99
+ return $this->getMethod()->getConfig()->getSepaRequestBic();
100
+ }
101
+
102
}
app/code/community/Payone/Core/Block/Payment/Method/Form/Financing.php DELETED
@@ -1,96 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the GNU General Public License (GPL 3)
7
- * that is bundled with this package in the file LICENSE.txt
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
- * versions in the future. If you wish to customize Payone_Core for your
13
- * needs please refer to http://www.payone.de for more information.
14
- *
15
- * @category Payone
16
- * @package Payone_Core_Block
17
- * @subpackage Payment
18
- * @copyright Copyright (c) 2012 <info@votum.de> - www.votum.de
19
- * @author Edward Mateja <edward.mateja@votum.de>
20
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
- * @link http://www.votum.de
22
- */
23
-
24
- /**
25
- *
26
- * @category Payone
27
- * @package Payone_Core_Block
28
- * @subpackage Payment
29
- * @copyright Copyright (c) 2012 <info@votum.de> - www.votum.de
30
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
- * @link http://www.votum.de
32
- */
33
- class Payone_Core_Block_Payment_Method_Form_Financing
34
- extends Payone_Core_Block_Payment_Method_Form_Abstract
35
- {
36
- protected $hasTypes = true;
37
-
38
- protected function _construct()
39
- {
40
- parent::_construct();
41
- $this->setTemplate('payone/core/payment/method/form/financing.phtml');
42
- }
43
-
44
- /**
45
- * @override To prevent display of fee config on payment method, as there might be different fees for each financing type
46
- *
47
- * @return string
48
- */
49
- public function getMethodLabelAfterHtml()
50
- {
51
- return '';
52
- }
53
-
54
- /**
55
- * @return array
56
- */
57
- protected function getSystemConfigMethodTypes()
58
- {
59
- return $this->getFactory()->getModelSystemConfigFinancingType()->toSelectArray();
60
- }
61
-
62
- /**
63
- * @return string
64
- */
65
- public function getBlockHtmlKlarna()
66
- {
67
- /** @var Payone_Core_Block_Payment_Method_Form_Financing_Klarna $block */
68
- $block = $this->getLayout()->createBlock('payone_core/payment_method_form_financing_klarna');
69
- $block->setQuote($this->getQuote());
70
- $block->setPaymentMethodConfig($this->getPaymentConfig());
71
- $html = $block->toHtml();
72
- return $html;
73
- }
74
-
75
- /**
76
- * @return bool
77
- */
78
- public function showBlockHtmlKlarna()
79
- {
80
- $types = $this->getTypes();
81
-
82
- if (count($types) == 1) {
83
- $type = array_pop($types);
84
- if ($type['code'] == Payone_Api_Enum_FinancingType::KLS) {
85
- return true;
86
- }
87
- } elseif (count($types) > 1) {
88
- foreach ($types as $type) {
89
- if ($type['code'] == Payone_Api_Enum_FinancingType::KLS) {
90
- return true;
91
- }
92
- }
93
- }
94
- return false;
95
- }
96
- }
app/code/community/Payone/Core/Block/Payment/Method/Form/Financing/Klarna.php DELETED
@@ -1,300 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the GNU General Public License (GPL 3)
7
- * that is bundled with this package in the file LICENSE.txt
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
- * versions in the future. If you wish to customize Payone_Core for your
13
- * needs please refer to http://www.payone.de for more information.
14
- *
15
- * @category Payone
16
- * @package Payone_Core_Block
17
- * @subpackage Payment
18
- * @copyright Copyright (c) 2013 <info@votum.de> - www.votum.de
19
- * @author Edward Mateja <edward.mateja@nvotum.de>
20
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
- * @link http://www.votum.de
22
- */
23
-
24
- /**
25
- *
26
- * @category Payone
27
- * @package Payone_Core_Block
28
- * @subpackage Payment
29
- * @copyright Copyright (c) 2013 <info@votum.de> - www.votum.de
30
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
- * @link http://www.votum.de
32
- */
33
-
34
- class Payone_Core_Block_Payment_Method_Form_Financing_Klarna
35
- extends Mage_Core_Block_Template
36
- {
37
- /** @var Payone_Core_Model_Config_Payment_Method_Interface */
38
- protected $paymentMethodConfig;
39
- /** @var Mage_Sales_Model_Quote */
40
- protected $quote;
41
- /** @var Payone_Core_Model_Factory */
42
- protected $factory = null;
43
-
44
- protected function _construct()
45
- {
46
- parent::_construct();
47
- $this->setTemplate('payone/core/payment/method/form/financing/klarna.phtml');
48
- }
49
-
50
- /**
51
- * @param \Payone_Core_Model_Config_Payment_Method_Interface $paymentMethodConfig
52
- */
53
- public function setPaymentMethodConfig($paymentMethodConfig)
54
- {
55
- $this->paymentMethodConfig = $paymentMethodConfig;
56
- }
57
-
58
- /**
59
- * @return \Payone_Core_Model_Config_Payment_Method_Interface
60
- */
61
- public function getPaymentMethodConfig()
62
- {
63
- return $this->paymentMethodConfig;
64
- }
65
-
66
- /**
67
- * @param \Mage_Sales_Model_Quote $quote
68
- */
69
- public function setQuote($quote)
70
- {
71
- $this->quote = $quote;
72
- }
73
-
74
- /**
75
- * @return \Mage_Sales_Model_Quote
76
- */
77
- public function getQuote()
78
- {
79
- return $this->quote;
80
- }
81
-
82
- /**
83
- * @return bool
84
- */
85
- public function isAgreementCheckboxRequired()
86
- {
87
- $country = $this->getCountry();
88
- if ($country == 'AT' or $country == 'DE') {
89
- return true;
90
- }
91
- return false;
92
- }
93
-
94
-
95
- /**
96
- * @return string
97
- */
98
- public function getKlarnaStoreId()
99
- {
100
- $country = $this->getCountry();
101
- $klarnaConfig = $this->getPaymentMethodConfig()->getKlarnaConfig();
102
- if (empty($klarnaConfig)) {
103
- return '';
104
- }
105
- foreach ($klarnaConfig as $config) {
106
- if (isset($config['countries']) and is_array($config['countries'])
107
- and in_array($country, $config['countries'])
108
- ) {
109
- return $config['klarna_store_id'];
110
- }
111
- }
112
- return '';
113
- }
114
-
115
- /**
116
- * @return string
117
- */
118
- public function getCountry()
119
- {
120
- $quote = $this->getQuote();
121
- $billing = $quote->getBillingAddress();
122
- return $billing->getCountry();
123
- }
124
-
125
- /**
126
- * @return string
127
- */
128
- public function getKlarnaCampaignCode()
129
- {
130
- $klarnaCampaignCode = $this->getPaymentMethodConfig()->getKlarnaCampaignCode();
131
- if (empty($klarnaCampaignCode)) {
132
- return '';
133
- }
134
- return $klarnaCampaignCode;
135
- }
136
-
137
- /**
138
- * @return bool
139
- */
140
- public function isDobRequired()
141
- {
142
- // required for all countries
143
- // required only if customer didn't enter Dob in previous checkout step
144
- $customerDob = $this->getQuote()->getCustomerDob();
145
- if (empty($customerDob)) {
146
- return true;
147
- }
148
- return false;
149
- }
150
-
151
- /**
152
- * @return bool
153
- */
154
- public function isTelephoneRequired()
155
- {
156
- // telephone is mandatory for any country in case of Klarna
157
- $telephone = $this->getQuote()->getBillingAddress()->getTelephone();
158
- if (empty($telephone)) {
159
- return true;
160
- }
161
-
162
- return false;
163
- }
164
-
165
- /**
166
- * @return bool
167
- */
168
- public function isGenderRequired()
169
- {
170
- // required only for Austria (AT), Germany (DE) and Netherlands (NL)
171
- $country = $this->getCountry();
172
- if ($country != 'AT' and $country != 'DE' and $country != 'NL') {
173
- return false;
174
- }
175
- // required only if customer didn't enter gender in his customer account or previous checkout step
176
- $customerGender = $this->getQuote()->getCustomerGender();
177
- if (empty($customerGender)) {
178
- return true;
179
- }
180
- return false;
181
- }
182
-
183
- /**
184
- * @return array
185
- */
186
- public function getGenderOptions()
187
- {
188
- $customerResource = $this->getFactory()->getSingletonCustomerResource();
189
- $options = $customerResource->getAttribute('gender')->getSource()->getAllOptions();
190
- $options = $this->_filterGenderOptions($options);
191
- return $options;
192
- }
193
-
194
- protected function _filterGenderOptions($options) {
195
- $aAdded = array();
196
- $aFilteredOptions = array();
197
- $aWhitelist = array(
198
- 'male' => array(
199
- 'male',
200
- 'm�nnlich',
201
- ),
202
- 'female' => array(
203
- 'female',
204
- 'weiblich',
205
- ),
206
- );
207
- foreach ($options as $aOption) {
208
- $sLowerLabel = strtolower($aOption['label']);
209
- if(array_search($sLowerLabel, $aAdded) === false) {
210
- foreach ($aWhitelist as $sKey => $aList) {
211
- if(array_search($sLowerLabel, $aList) !== false) {
212
- $aAdded[] = $sLowerLabel;
213
- $aFilteredOptions[] = $aOption;
214
- unset($aWhitelist[$sKey]);// only allow one of the whitelisted gender-terms
215
- }
216
- }
217
- }
218
- }
219
- return $aFilteredOptions;
220
- }
221
-
222
- /**
223
- * @return bool
224
- */
225
- public function isPersonalidRequired()
226
- {
227
- $country = $this->getCountry();
228
- // mandatory for Denmark (DK), Finland(FI), Norway (NO) and Sweden (SE)
229
- if ($country == 'DK' or $country == 'FI' or $country == 'NO' or $country == 'SE') {
230
- return true;
231
- }
232
- return false;
233
- }
234
-
235
- /**
236
- * @return bool
237
- */
238
- public function isShippingAddressAdditionRequired()
239
- {
240
- $shippingAddress = $this->getQuote()->getShippingAddress();
241
- $country = $shippingAddress->getCountry();
242
- // required only for Netherlands (NL)
243
- if ($country != 'NL') {
244
- return false;
245
- }
246
-
247
- $addressAdditionShipping = $shippingAddress->getStreet(2);
248
- if (empty($addressAdditionShipping)) {
249
- return true;
250
- }
251
-
252
- return false;
253
- }
254
-
255
- public function isBillingAddressAdditionRequired()
256
- {
257
- $billingAddress = $this->getQuote()->getBillingAddress();
258
- $country = $billingAddress->getCountry();
259
- // required only for Netherlands (NL)
260
- if ($country != 'NL') {
261
- return false;
262
- }
263
- $addressAdditionBilling = $billingAddress->getStreet(2);
264
- if (empty($addressAdditionBilling)) {
265
- return true;
266
- }
267
- return false;
268
- }
269
-
270
- /**
271
- * @return bool
272
- */
273
- public function canShowAdditionalFields()
274
- {
275
- $country = $this->getCountry();
276
- if (empty($country)) {
277
- return false;
278
- }
279
- return true;
280
- }
281
-
282
- /**
283
- * @param \Payone_Core_Model_Factory $factory
284
- */
285
- public function setFactory(Payone_Core_Model_Factory $factory)
286
- {
287
- $this->factory = $factory;
288
- }
289
-
290
- /**
291
- * @return \Payone_Core_Model_Factory
292
- */
293
- public function getFactory()
294
- {
295
- if ($this->factory === null) {
296
- $this->factory = new Payone_Core_Model_Factory();
297
- }
298
- return $this->factory;
299
- }
300
- }
app/code/community/Payone/Core/Block/Payment/Method/Form/OnlineBankTransfer.php CHANGED
@@ -103,4 +103,14 @@ class Payone_Core_Block_Payment_Method_Form_OnlineBankTransfer
103
return 0;
104
}
105
}
106
}
103
return 0;
104
}
105
}
106
+
107
+ /**
108
+ * Return if iban+bic have to be shown for Sofort�berweisung
109
+ *
110
+ * @return bool
111
+ */
112
+ public function showSofortUeberweisungBankDataFields()
113
+ {
114
+ return $this->getMethod()->getConfig()->getSofortueberweisungShowIban();
115
+ }
116
}
app/code/community/Payone/Core/Block/Payment/Method/Info/Financing.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the GNU General Public License (GPL 3)
7
- * that is bundled with this package in the file LICENSE.txt
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
- * versions in the future. If you wish to customize Payone_Core for your
13
- * needs please refer to http://www.payone.de for more information.
14
- *
15
- * @category Payone
16
- * @package Payone_Core_Block
17
- * @subpackage Payment
18
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
- * @author Matthias Walter <info@noovias.com>
20
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
- * @link http://www.noovias.com
22
- */
23
-
24
- /**
25
- *
26
- * @category Payone
27
- * @package Payone_Core_Block
28
- * @subpackage Payment
29
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
- * @link http://www.noovias.com
32
- */
33
- class Payone_Core_Block_Payment_Method_Info_Financing
34
- extends Payone_Core_Block_Payment_Method_Info_Abstract
35
- {
36
- protected function _construct()
37
- {
38
- parent::_construct();
39
- $this->setTemplate('payone/core/payment/method/info/financing.phtml');
40
-
41
- }
42
-
43
- /**
44
- * @return string
45
- */
46
- public function getFinancingType()
47
- {
48
- $model = $this->getFactory()->getModelSystemConfigFinancingType();
49
- $array = $model->toSelectArray();
50
- return $array[$this->getInfo()->getPayoneFinancingType()];
51
- }
52
- }
app/code/community/Payone/Core/Model/Config/General/StatusMapping.php CHANGED
@@ -68,6 +68,9 @@ class Payone_Core_Model_Config_General_StatusMapping extends Payone_Core_Model_C
68
* @var null
69
*/
70
protected $wallet = null;
71
72
public function init(array $data)
73
{
@@ -260,6 +263,22 @@ class Payone_Core_Model_Config_General_StatusMapping extends Payone_Core_Model_C
260
}
261
$this->wallet = $wallet;
262
}
263
264
/**
265
* @return null
@@ -268,6 +287,16 @@ class Payone_Core_Model_Config_General_StatusMapping extends Payone_Core_Model_C
268
{
269
return $this->wallet;
270
}
271
272
/**
273
* @param null $financing
68
* @var null
69
*/
70
protected $wallet = null;
71
+
72
+ protected $ratepay = null;
73
+ protected $payolution = null;
74
75
public function init(array $data)
76
{
263
}
264
$this->wallet = $wallet;
265
}
266
+
267
+ public function setRatepay($ratepay)
268
+ {
269
+ if (is_string($ratepay)) {
270
+ $ratepay = $this->initValue($ratepay);
271
+ }
272
+ $this->ratepay = $ratepay;
273
+ }
274
+
275
+ public function setPayolution($payolution)
276
+ {
277
+ if (is_string($payolution)) {
278
+ $payolution = $this->initValue($payolution);
279
+ }
280
+ $this->payolution = $payolution;
281
+ }
282
283
/**
284
* @return null
287
{
288
return $this->wallet;
289
}
290
+
291
+ public function getRatepay()
292
+ {
293
+ return $this->ratepay;
294
+ }
295
+
296
+ public function getPayolution()
297
+ {
298
+ return $this->payolution;
299
+ }
300
301
/**
302
* @param null $financing
app/code/community/Payone/Core/Model/Config/Payment/Method.php CHANGED
@@ -221,7 +221,17 @@ class Payone_Core_Model_Config_Payment_Method
221
* @var bool
222
*/
223
protected $b2b_mode = false;
224
225
/**
226
* Check if Method can be used in Country
227
*
@@ -1073,4 +1083,36 @@ class Payone_Core_Model_Config_Payment_Method
1073
return $this->b2b_mode;
1074
}
1075
1076
}
221
* @var bool
222
*/
223
protected $b2b_mode = false;
224
+
225
+ /**
226
+ * @var bool
227
+ */
228
+ protected $sofortueberweisung_show_iban = false;
229
230
+ /**
231
+ * @var bool
232
+ */
233
+ protected $sepa_request_bic = false;
234
+
235
/**
236
* Check if Method can be used in Country
237
*
1083
return $this->b2b_mode;
1084
}
1085
1086
+ /**
1087
+ * @param bool $show_iban
1088
+ */
1089
+ public function setSofortueberweisungShowIban($show_iban)
1090
+ {
1091
+ $this->sofortueberweisung_show_iban = (bool)$show_iban;
1092
+ }
1093
+
1094
+ /**
1095
+ * @return bool
1096
+ */
1097
+ public function getSofortueberweisungShowIban()
1098
+ {
1099
+ return (bool)$this->sofortueberweisung_show_iban;
1100
+ }
1101
+
1102
+ /**
1103
+ * @param bool $show_iban
1104
+ */
1105
+ public function setSepaRequestBic($request_bic)
1106
+ {
1107
+ $this->sepa_request_bic = (bool)$request_bic;
1108
+ }
1109
+
1110
+ /**
1111
+ * @return bool
1112
+ */
1113
+ public function getSepaRequestBic()
1114
+ {
1115
+ return (bool)$this->sepa_request_bic;
1116
+ }
1117
+
1118
}
app/code/community/Payone/Core/Model/Config/Payment/Method/Interface.php CHANGED
@@ -499,4 +499,24 @@ interface Payone_Core_Model_Config_Payment_Method_Interface
499
*/
500
public function getB2bMode();
501
502
}
499
*/
500
public function getB2bMode();
501
502
+ /**
503
+ * @param bool $show_iban
504
+ */
505
+ public function setSofortueberweisungShowIban($show_iban);
506
+
507
+ /**
508
+ * @return bool
509
+ */
510
+ public function getSofortueberweisungShowIban();
511
+
512
+ /**
513
+ * @param bool $request_bic
514
+ */
515
+ public function setSepaRequestBic($request_bic);
516
+
517
+ /**
518
+ * @return bool
519
+ */
520
+ public function getSepaRequestBic();
521
+
522
}
app/code/community/Payone/Core/Model/Factory.php CHANGED
@@ -1569,15 +1569,6 @@ class Payone_Core_Model_Factory
1569
return Mage::getSingleton('payone_core/system_config_walletType');
1570
}
1571
1572
- /**
1573
- * @return Payone_Core_Model_System_Config_FinancingType
1574
- */
1575
- public function getModelSystemConfigFinancingType()
1576
- {
1577
- return Mage::getSingleton('payone_core/system_config_financingType');
1578
- }
1579
-
1580
-
1581
/**
1582
* @return Payone_Core_Model_System_Config_SafeInvoiceType
1583
*/
1569
return Mage::getSingleton('payone_core/system_config_walletType');
1570
}
1571
1572
/**
1573
* @return Payone_Core_Model_System_Config_SafeInvoiceType
1574
*/
app/code/community/Payone/Core/Model/Handler/Payment/Abstract.php CHANGED
@@ -180,10 +180,6 @@ abstract class Payone_Core_Model_Handler_Payment_Abstract
180
$order->setData('payone_payment_method_type',
181
$this->getPayment()->getData('payone_onlinebanktransfer_type'));
182
}
183
- elseif ($this->getPaymentMethod() instanceof Payone_Core_Model_Payment_Method_Financing) {
184
- $order->setData('payone_payment_method_type',
185
- $this->getPayment()->getData('payone_financing_type'));
186
- }
187
elseif ($this->getPaymentMethod() instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
188
$order->setData('payone_payment_method_type',
189
$this->getPayment()->getData('payone_safe_invoice_type'));
180
$order->setData('payone_payment_method_type',
181
$this->getPayment()->getData('payone_onlinebanktransfer_type'));
182
}
183
elseif ($this->getPaymentMethod() instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
184
$order->setData('payone_payment_method_type',
185
$this->getPayment()->getData('payone_safe_invoice_type'));
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Authorize/Abstract.php CHANGED
@@ -117,13 +117,6 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
117
$paymentMethod = $this->getPaymentMethod();
118
119
$requestType = $this->configPayment->getRequestType();
120
- // Always use PREAUTHORIZATION for Financing of type "Commerz Finanz"
121
- if ($paymentMethod instanceof Payone_Core_Model_Payment_Method_Financing) {
122
- $financingType = $paymentMethod->getInfoInstance()->getPayoneFinancingType();
123
- if ($financingType == Payone_Api_Enum_FinancingType::CFR) {
124
- $requestType = Payone_Api_Enum_RequestType::PREAUTHORIZATION;
125
- }
126
- }
127
// Always use PREAUTHORIZATION for Safe Invoice of type "Klarna"
128
if ($paymentMethod instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
129
$safeInvoiceType = $paymentMethod->getInfoInstance()->getPayoneSafeInvoiceType();
@@ -232,14 +225,6 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
232
) {
233
$personalData = $this->mapPersonalParametersSafeInvoiceKlarna($personalData);
234
}
235
-
236
- // Financing "Klarna" specific personal parameters mapping
237
- if ($paymentMethod instanceof Payone_Core_Model_Payment_Method_Financing
238
- and $paymentMethod->getInfoInstance()->getPayoneFinancingType() == Payone_Api_Enum_FinancingType::KLS
239
- ) {
240
- $personalData = $this->mapPersonalParametersSafeInvoiceKlarna($personalData);
241
- }
242
-
243
return $personalData;
244
}
245
@@ -478,6 +463,8 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
478
$payoneOnlinebanktransferType = $info->getPayoneOnlinebanktransferType();
479
$iban = $info->getPayoneSepaIban();
480
$bic = $info->getPayoneSepaBic();
481
482
$payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_OnlineBankTransfer();
483
$payment->setBankcountry($country);
@@ -486,13 +473,12 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
486
switch ($payoneOnlinebanktransferType) {
487
case Payone_Api_Enum_OnlinebanktransferType::INSTANT_MONEY_TRANSFER:
488
case Payone_Api_Enum_OnlinebanktransferType::GIROPAY:
489
- if (!empty($iban) and !empty($bic)) {
490
$payment->setIban(strtoupper($iban));
491
$payment->setBic(strtoupper($bic)); // ensure bic and iban are sent uppercase
492
- }
493
- else {
494
- $payment->setBankaccount($info->getPayoneAccountNumber());
495
- $payment->setBankcode($info->getPayoneBankCode());
496
}
497
break;
498
case Payone_Api_Enum_OnlinebanktransferType::IDEAL:
@@ -507,26 +493,6 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
507
508
$isRedirect = true;
509
}
510
- elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_Financing) {
511
-
512
- $payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_Financing();
513
- $payment->setFinancingtype($info->getPayoneFinancingType());
514
-
515
- if($info->getPayoneFinancingType() == Payone_Api_Enum_FinancingType::KLS) {
516
- $configPaymentMethodId = $info->getPayoneConfigPaymentMethodId();
517
- $paymentConfig = $paymentMethod->getConfigPayment();
518
-
519
-
520
- $payData = new Payone_Api_Request_Parameter_Paydata_Paydata();
521
- $payData->addItem(new Payone_Api_Request_Parameter_Paydata_DataItem(
522
- array('key' => 'klsid', 'data' => $info->getPayoneKlarnaCampaignCode())
523
- ));
524
- $payment->setPaydata($payData);
525
- }
526
-
527
- $isRedirect = true;
528
- }
529
-
530
elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
531
532
$payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_Financing();
@@ -547,11 +513,13 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
547
$payment->setBankcountry($info->getPayoneBankCountry());
548
$iban = $info->getPayoneSepaIban();
549
$bic = $info->getPayoneSepaBic();
550
- if (!empty($iban) and !empty($bic)) {
551
$payment->setIban(strtoupper($iban));
552
- $payment->setBic(strtoupper($bic)); // ensure bic and iban are sent uppercase
553
- }
554
- else {
555
$payment->setBankaccount($info->getPayoneAccountNumber());
556
$payment->setBankcode($info->getPayoneBankCode());
557
}
@@ -610,9 +578,9 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
610
$payment->setApiVersion();
611
$payment->setFinancingtype($info->getPayonePayolutionType());
612
$payment->setWorkorderid($info->getPayoneWorkorderid());
613
- $payment->setIban(strtoupper($info->getPayoneSepaIban()));
614
- $payment->setBic(strtoupper($info->getPayoneSepaBic()));
615
-
616
$checkoutSession = $this->getFactory()->getSingletonCheckoutSession();
617
$payment->setWorkorderid($checkoutSession->getPayoneWorkorderId());
618
$info->setPayoneWorkorderId($checkoutSession->getPayoneWorkorderId());
@@ -694,9 +662,6 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
694
elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_DebitPayment) {
695
$clearingType = Payone_Enum_ClearingType::DEBITPAYMENT;
696
}
697
- elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_Financing) {
698
- $clearingType = Payone_Enum_ClearingType::FINANCING;
699
- }
700
elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
701
$clearingType = Payone_Enum_ClearingType::FINANCING;
702
}
117
$paymentMethod = $this->getPaymentMethod();
118
119
$requestType = $this->configPayment->getRequestType();
120
// Always use PREAUTHORIZATION for Safe Invoice of type "Klarna"
121
if ($paymentMethod instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
122
$safeInvoiceType = $paymentMethod->getInfoInstance()->getPayoneSafeInvoiceType();
225
) {
226
$personalData = $this->mapPersonalParametersSafeInvoiceKlarna($personalData);
227
}
228
return $personalData;
229
}
230
463
$payoneOnlinebanktransferType = $info->getPayoneOnlinebanktransferType();
464
$iban = $info->getPayoneSepaIban();
465
$bic = $info->getPayoneSepaBic();
466
+ $bankaccount = $info->getPayoneAccountNumber();
467
+ $bankcode = $info->getPayoneBankCode();
468
469
$payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_OnlineBankTransfer();
470
$payment->setBankcountry($country);
473
switch ($payoneOnlinebanktransferType) {
474
case Payone_Api_Enum_OnlinebanktransferType::INSTANT_MONEY_TRANSFER:
475
case Payone_Api_Enum_OnlinebanktransferType::GIROPAY:
476
+ if (!empty($iban) && !empty($bic)) {
477
$payment->setIban(strtoupper($iban));
478
$payment->setBic(strtoupper($bic)); // ensure bic and iban are sent uppercase
479
+ } elseif (!empty($bankaccount) && !empty($bankcode)) {
480
+ $payment->setBankaccount($bankaccount);
481
+ $payment->setBankcode($bankcode);
482
}
483
break;
484
case Payone_Api_Enum_OnlinebanktransferType::IDEAL:
493
494
$isRedirect = true;
495
}
496
elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
497
498
$payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_Financing();
513
$payment->setBankcountry($info->getPayoneBankCountry());
514
$iban = $info->getPayoneSepaIban();
515
$bic = $info->getPayoneSepaBic();
516
+
517
+ if (!empty($iban)) {
518
$payment->setIban(strtoupper($iban));
519
+ if(!empty($bic)) {
520
+ $payment->setBic(strtoupper($bic)); // ensure bic and iban are sent uppercase
521
+ }
522
+ } else {
523
$payment->setBankaccount($info->getPayoneAccountNumber());
524
$payment->setBankcode($info->getPayoneBankCode());
525
}
578
$payment->setApiVersion();
579
$payment->setFinancingtype($info->getPayonePayolutionType());
580
$payment->setWorkorderid($info->getPayoneWorkorderid());
581
+ $payment->setIban(strtoupper($info->getPayonePayolutionIban()));
582
+ $payment->setBic(strtoupper($info->getPayonePayolutionBic()));
583
+
584
$checkoutSession = $this->getFactory()->getSingletonCheckoutSession();
585
$payment->setWorkorderid($checkoutSession->getPayoneWorkorderId());
586
$info->setPayoneWorkorderId($checkoutSession->getPayoneWorkorderId());
662
elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_DebitPayment) {
663
$clearingType = Payone_Enum_ClearingType::DEBITPAYMENT;
664
}
665
elseif ($paymentMethod instanceof Payone_Core_Model_Payment_Method_SafeInvoice) {
666
$clearingType = Payone_Enum_ClearingType::FINANCING;
667
}
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Debit.php CHANGED
@@ -196,8 +196,8 @@ class Payone_Core_Model_Mapper_ApiRequest_Payment_Debit
196
197
// Add Discount as a position
198
$discountAmount = $creditmemo->getDiscountAmount();
199
- if ($discountAmount > 0) {
200
- $invoicing->addItem($this->mapDiscountAsItem(-1 * $discountAmount));
201
}
202
}
203
return $invoicing;
196
197
// Add Discount as a position
198
$discountAmount = $creditmemo->getDiscountAmount();
199
+ if ($discountAmount) {
200
+ $invoicing->addItem($this->mapDiscountAsItem($discountAmount));
201
}
202
}
203
return $invoicing;
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Genericpayment.php CHANGED
@@ -102,7 +102,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Payment_Genericpayment
102
return $request;
103
}
104
105
- public function addRatePayParameters($sRatePayShopId) {
106
$request = $this->getRequest();
107
$this->mapDefaultParameters($request);
108
$paydata = new Payone_Api_Request_Parameter_Paydata_Paydata();
@@ -115,7 +115,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Payment_Genericpayment
115
$request->setPaydata($paydata);
116
$request->setAid($this->getConfigPayment()->getAid());
117
$request->setClearingtype(Payone_Enum_ClearingType::FINANCING);
118
- $request->setCurrency('EUR');
119
$request->setFinancingType(Payone_Api_Enum_RatepayType::RPV);
120
return $request;
121
}
102
return $request;
103
}
104
105
+ public function addRatePayParameters($sRatePayShopId, $sCurrency) {
106
$request = $this->getRequest();
107
$this->mapDefaultParameters($request);
108
$paydata = new Payone_Api_Request_Parameter_Paydata_Paydata();
115
$request->setPaydata($paydata);
116
$request->setAid($this->getConfigPayment()->getAid());
117
$request->setClearingtype(Payone_Enum_ClearingType::FINANCING);
118
+ $request->setCurrency($sCurrency);
119
$request->setFinancingType(Payone_Api_Enum_RatepayType::RPV);
120
return $request;
121
}
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/BankAccountCheck.php CHANGED
@@ -73,9 +73,11 @@ class Payone_Core_Model_Mapper_ApiRequest_Verification_BankAccountCheck
73
$request->setBankaccount($bankaccount);
74
$request->setBankcode($bankcode);
75
$request->setBankcountry($bankcountry);
76
- if (!empty($iban) and !empty($bic)) {
77
$request->setIban(strtoupper($iban));
78
- $request->setBic(strtoupper($bic)); // ensure bic and iban are sent uppercase
79
}
80
81
73
$request->setBankaccount($bankaccount);
74
$request->setBankcode($bankcode);
75
$request->setBankcountry($bankcountry);
76
+ if (!empty($iban)) {
77
$request->setIban(strtoupper($iban));
78
+ if (!empty($bic)) {
79
+ $request->setBic(strtoupper($bic)); // ensure bic and iban are sent uppercase
80
+ }
81
}
82
83
app/code/community/Payone/Core/Model/Observer/Sales/Order.php CHANGED
@@ -47,7 +47,7 @@ class Payone_Core_Model_Observer_Sales_Order
47
48
$resource->addVirtualGridColumn(
49
'payone_payment_method',
50
- 'order_payment',
51
array('entity_id' => 'parent_id'),
52
'method'
53
);
47
48
$resource->addVirtualGridColumn(
49
'payone_payment_method',
50
+ 'sales/order_payment',
51
array('entity_id' => 'parent_id'),
52
'method'
53
);
app/code/community/Payone/Core/Model/Payment/Method/Abstract.php CHANGED
@@ -173,7 +173,6 @@ abstract class Payone_Core_Model_Payment_Method_Abstract
173
174
if ($this->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::CREDITCARD
175
or $this->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::SAFEINVOICE
176
- or $this->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::FINANCING
177
) {
178
// Capture with amount=0, to notify PAYONE that the order is complete (invoiced/cancelled all items)
179
// Only works with Creditcard at the moment (15.10.2013)
173
174
if ($this->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::CREDITCARD
175
or $this->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::SAFEINVOICE
176
) {
177
// Capture with amount=0, to notify PAYONE that the order is complete (invoiced/cancelled all items)
178
// Only works with Creditcard at the moment (15.10.2013)
app/code/community/Payone/Core/Model/Payment/Method/Financing.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the GNU General Public License (GPL 3)
7
- * that is bundled with this package in the file LICENSE.txt
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
- * versions in the future. If you wish to customize Payone_Core for your
13
- * needs please refer to http://www.payone.de for more information.
14
- *
15
- * @category Payone
16
- * @package Payone_Core_Model
17
- * @subpackage Payment
18
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
- * @author Matthias Walter <info@noovias.com>
20
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
- * @link http://www.noovias.com
22
- */
23
-
24
- /**
25
- *
26
- * @category Payone
27
- * @package Payone_Core_Model
28
- * @subpackage Payment
29
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
- * @link http://www.noovias.com
32
- */
33
- class Payone_Core_Model_Payment_Method_Financing
34
- extends Payone_Core_Model_Payment_Method_Abstract
35
- {
36
- protected $_canRefund = false;
37
- protected $_canRefundInvoicePartial = false;
38
- protected $_canUseInternal = false;
39
-
40
- protected $methodType = Payone_Core_Model_System_Config_PaymentMethodType::FINANCING;
41
-
42
- protected $_code = Payone_Core_Model_System_Config_PaymentMethodCode::FINANCING;
43
-
44
- /** @var Payone_Core_Model_Config_Payment_Method_Interface[] */
45
- protected $matchingConfigs = array();
46
-
47
-
48
- /**
49
- * @param Varien_Object $payment
50
- * @return Mage_Payment_Model_Method_Abstract
51
- */
52
- public function cancel(Varien_Object $payment)
53
- {
54
- $status = $payment->getOrder()->getPayoneTransactionStatus();
55
-
56
- if(empty($status) or $status == 'REDIRECT')
57
- return $this; // Don´t send cancel to PAYONE on orders without TxStatus
58
-
59
- $this->capture($payment, 0.0000);
60
-
61
- return $this;
62
- }
63
-
64
- /**
65
- * @api
66
- *
67
- * To be used in Form_Block, which has to display all financing types
68
- *
69
- * @param Mage_Sales_Model_Quote $quote
70
- * @return Payone_Core_Model_Config_Payment_Method_Interface
71
- */
72
- public function getAllConfigsByQuote(Mage_Sales_Model_Quote $quote)
73
- {
74
- if (empty($this->matchingConfigs)) {
75
- $configStore = $this->getConfigStore($quote->getStoreId());
76
-
77
- $this->matchingConfigs = $configStore->getPayment()->getMethodsForQuote($this->methodType, $quote);
78
- }
79
- return $this->matchingConfigs;
80
- }
81
-
82
- protected $_formBlockType = 'payone_core/payment_method_form_financing';
83
- protected $_infoBlockType = 'payone_core/payment_method_info_financing';
84
-
85
-
86
- }
app/code/community/Payone/Core/Model/Repository/Api.php CHANGED
@@ -61,7 +61,7 @@ class Payone_Core_Model_Repository_Api
61
$domainObject = $this->getFactory()->getModelApi();
62
$domainObject->setData($request->toArray());
63
$domainObject->setRawRequest($request->__toString());
64
- $domainObject->setRawResponse($response->__toString());
65
$domainObject->setResponse($response->getStatus());
66
$domainObject->save();
67
}
61
$domainObject = $this->getFactory()->getModelApi();
62
$domainObject->setData($request->toArray());
63
$domainObject->setRawRequest($request->__toString());
64
+ $domainObject->setRawResponse($response->getRawResponseToString());
65
$domainObject->setResponse($response->getStatus());
66
$domainObject->save();
67
}
app/code/community/Payone/Core/Model/Sales/Quote/Address/Total/Fee.php CHANGED
@@ -92,14 +92,16 @@ class Payone_Core_Model_Sales_Quote_Address_Total_Fee
92
return parent::collect($address);
93
}
94
95
- protected function _setNewPayonePaymentAmount($oQuote, $oAddess, $dPaymentFee) {
96
- $dOldShippingAmount = $oAddess->getBaseShippingAmount();
97
$dNewShippingAmount = $dOldShippingAmount + $dPaymentFee;
98
99
- $oAddess->setBaseShippingAmount($dNewShippingAmount);
100
- $oAddess->setShippingAmount(
101
$oQuote->getStore()->convertPrice($dNewShippingAmount, false)
102
- );
103
}
104
105
/**
92
return parent::collect($address);
93
}
94
95
+ protected function _setNewPayonePaymentAmount($oQuote, $oAddress, $dPaymentFee) {
96
+ $dOldShippingAmount = $oAddress->getBaseShippingAmount();
97
$dNewShippingAmount = $dOldShippingAmount + $dPaymentFee;
98
99
+ $oAddress->setData('payone_payment_fee', $dPaymentFee);
100
+
101
+ $oAddress->setBaseShippingAmount($dNewShippingAmount);
102
+ $oAddress->setShippingAmount(
103
$oQuote->getStore()->convertPrice($dNewShippingAmount, false)
104
+ );
105
}
106
107
/**
app/code/community/Payone/Core/Model/Service/Config/XmlGenerate.php CHANGED
@@ -163,8 +163,8 @@ class Payone_Core_Model_Service_Config_XmlGenerate
163
/** @var $globalConfig Payone_Settings_Data_ConfigFile_Shop_Global */
164
$globalConfig = $this->generateSettingsBySection('shop_global', $global);
165
$statusMappingConfig = new Payone_Settings_Data_ConfigFile_Global_StatusMapping();
166
- foreach ($statusMapping->toArray() as $keyClearingType => $mapping) {
167
- $keyClearingType = $this->getPayoneShortKey($keyClearingType);
168
if ($keyClearingType !== NULL) {
169
$data = array();
170
@@ -177,6 +177,7 @@ class Payone_Core_Model_Service_Config_XmlGenerate
177
$mapTo = implode('|', $value);
178
}
179
$singleMap['to'] = $mapTo;
180
181
array_push($data, $singleMap);
182
}
@@ -239,31 +240,6 @@ class Payone_Core_Model_Service_Config_XmlGenerate
239
240
}
241
242
- if ($paymentMethodConfig instanceof Payone_Settings_Data_ConfigFile_PaymentMethod_Financing) {
243
- /** @var Payone_Settings_Data_ConfigFile_PaymentMethod_Financing $paymentMethodConfig */
244
- $klarnaConfigs = $paymentMethod->getKlarnaConfig();
245
- $klarnaConfigArray = array();
246
- if (is_array($klarnaConfigs)) {
247
- foreach ($klarnaConfigs as $klarnaConfig) {
248
- $attributeCountry = '';
249
- if (is_array($klarnaConfig)) {
250
- if (array_key_exists('countries', $klarnaConfig)) {
251
- $attributeCountry = implode(',', $klarnaConfig['countries']);
252
- }
253
- }
254
- $attributeArray = array(
255
- 'countries' => $attributeCountry
256
- );
257
- $configArray = array(
258
- 'value' => array_key_exists('klarna_store_id', $klarnaConfig) ? $klarnaConfig['klarna_store_id'] : '',
259
- 'attribute' => $attributeArray
260
- );
261
- array_push($klarnaConfigArray, $configArray);
262
- }
263
- }
264
- $paymentMethodConfig->setKlarnaConfig($klarnaConfigArray);
265
- }
266
-
267
$feeConfigs = $paymentMethod->getFeeConfig();
268
$feeConfigArray = array();
269
if (is_array($feeConfigs)) {
@@ -403,8 +379,7 @@ class Payone_Core_Model_Service_Config_XmlGenerate
403
{
404
$key = strtoupper(uc_words($key, ''));
405
$clearingTypes = $this->getFactory()->getModelSystemConfigClearingType();
406
- $keyArray = $clearingTypes->toArray();
407
- $keyArray = array_flip($keyArray);
408
if (array_key_exists($key, $keyArray)) {
409
return $keyArray[$key];
410
}
163
/** @var $globalConfig Payone_Settings_Data_ConfigFile_Shop_Global */
164
$globalConfig = $this->generateSettingsBySection('shop_global', $global);
165
$statusMappingConfig = new Payone_Settings_Data_ConfigFile_Global_StatusMapping();
166
+ foreach ($statusMapping->toArray() as $paymentMethod => $mapping) {
167
+ $keyClearingType = $this->getPayoneShortKey($paymentMethod);
168
if ($keyClearingType !== NULL) {
169
$data = array();
170
177
$mapTo = implode('|', $value);
178
}
179
$singleMap['to'] = $mapTo;
180
+ $singleMap['method'] = $paymentMethod;
181
182
array_push($data, $singleMap);
183
}
240
241
}
242
243
$feeConfigs = $paymentMethod->getFeeConfig();
244
$feeConfigArray = array();
245
if (is_array($feeConfigs)) {
379
{
380
$key = strtoupper(uc_words($key, ''));
381
$clearingTypes = $this->getFactory()->getModelSystemConfigClearingType();
382
+ $keyArray = $clearingTypes->toArrayNoFlip();
383
if (array_key_exists($key, $keyArray)) {
384
return $keyArray[$key];
385
}
app/code/community/Payone/Core/Model/System/Config/AuthorizeMethodFinancing.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the GNU General Public License (GPL 3)
7
- * that is bundled with this package in the file LICENSE.txt
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
- * versions in the future. If you wish to customize Payone_Core for your
13
- * needs please refer to http://www.payone.de for more information.
14
- *
15
- * @category Payone
16
- * @package Payone_Core_Model
17
- * @subpackage System
18
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
- * @author Matthias Walter <info@noovias.com>
20
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
- * @link http://www.noovias.com
22
- */
23
-
24
- /**
25
- *
26
- * @category Payone
27
- * @package Payone_Core_Model
28
- * @subpackage System
29
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
- * @link http://www.noovias.com
32
- */
33
- class Payone_Core_Model_System_Config_AuthorizeMethodFinancing extends Payone_Core_Model_System_Config_Abstract
34
- {
35
- const PREAUTHORIZATION = Payone_Api_Enum_RequestType::PREAUTHORIZATION;
36
-
37
- /**
38
- * @return array
39
- */
40
- public function toArray()
41
- {
42
- return array(
43
- self::PREAUTHORIZATION => 'PREAUTHORIZATION',
44
- );
45
- }
46
- }
app/code/community/Payone/Core/Model/System/Config/ClearingType.php CHANGED
@@ -41,5 +41,14 @@ class Payone_Core_Model_System_Config_ClearingType extends Payone_Core_Model_Sys
41
$settings = new Payone_Settings_Configuration_PaymentMethod();
42
return $settings->getTypes();
43
}
44
45
}
41
$settings = new Payone_Settings_Configuration_PaymentMethod();
42
return $settings->getTypes();
43
}
44
+
45
+ /**
46
+ * @return array
47
+ */
48
+ public function toArrayNoFlip()
49
+ {
50
+ $settings = new Payone_Settings_Configuration_PaymentMethod();
51
+ return $settings->getTypes(false);
52
+ }
53
54
}
app/code/community/Payone/Core/Model/System/Config/FinancingType.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the GNU General Public License (GPL 3)
7
- * that is bundled with this package in the file LICENSE.txt
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
- * versions in the future. If you wish to customize Payone_Core for your
13
- * needs please refer to http://www.payone.de for more information.
14
- *
15
- * @category Payone
16
- * @package Payone_Core_Model
17
- * @subpackage System
18
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
- * @author Edward Mateja <edward.mateja@votum.de>
20
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
- * @link http://www.votum.de
22
- */
23
-
24
- /**
25
- *
26
- * @category Payone
27
- * @package Payone_Core_Model
28
- * @subpackage System
29
- * @copyright Copyright (c) 2012 <info@votum.de> - www.votum.de
30
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
- * @link http://www.votum.de
32
- */
33
- class Payone_Core_Model_System_Config_FinancingType extends Payone_Core_Model_System_Config_Abstract
34
- {
35
- /**
36
- * @return array
37
- */
38
- public function toArray()
39
- {
40
- $types = array(
41
- Payone_Api_Enum_FinancingType::CFR => Payone_Api_Enum_FinancingType::CFR,
42
- Payone_Api_Enum_FinancingType::KLS => Payone_Api_Enum_FinancingType::KLS,
43
- );
44
-
45
- return $types;
46
-
47
- // $settings = new Payone_Settings_Configuration_PaymentMethod_Financing();
48
- //
49
- // $types = $settings->getTypes();
50
- // if(array_key_exists(Payone_Api_Enum_FinancingType::BSV, $types))
51
- // unset($types[Payone_Api_Enum_FinancingType::BSV]); // BSV has a separate Payment method.
52
- // if(array_key_exists(Payone_Api_Enum_FinancingType::KLV, $types))
53
- // unset($types[Payone_Api_Enum_FinancingType::KLV]); // KLV has a separate Payment method.
54
- // return $types;
55
- }
56
- }
app/code/community/Payone/Core/Model/System/Config/MethodType.php CHANGED
@@ -41,14 +41,12 @@ class Payone_Core_Model_System_Config_MethodType
41
$settingsCreditcard = new Payone_Settings_Configuration_PaymentMethod_CreditCard();
42
$settingsOnlineBankTransfer = new Payone_Settings_Configuration_PaymentMethod_OnlineBankTransfer();
43
$settingsWallet = new Payone_Settings_Configuration_PaymentMethod_Wallet();
44
- $settingsFinancing = new Payone_Settings_Configuration_PaymentMethod_Financing();
45
$settingsSafeInvoice = new Payone_Settings_Configuration_PaymentMethod_Financing();
46
47
$return = array_merge(
48
$settingsCreditcard->getTypes(),
49
$settingsOnlineBankTransfer->getTypes(),
50
$settingsWallet->getTypes(),
51
- $settingsFinancing->getTypes(),
52
$settingsSafeInvoice->getTypes()
53
);
54
@@ -63,14 +61,12 @@ class Payone_Core_Model_System_Config_MethodType
63
$settingsCreditcard = new Payone_Settings_Configuration_PaymentMethod_CreditCard();
64
$settingsOnlineBankTransfer = new Payone_Settings_Configuration_PaymentMethod_OnlineBankTransfer();
65
$settingsWallet = new Payone_Settings_Configuration_PaymentMethod_Wallet();
66
- $settingsFinancing = new Payone_Core_Model_System_Config_FinancingType();
67
$settingsSafeInvoice = new Payone_Core_Model_System_Config_SafeInvoiceType();
68
69
$return = array(
70
'Creditcard' => $settingsCreditcard->getTypes(),
71
'Online Bank Transfer' => $settingsOnlineBankTransfer->getTypes(),
72
'Wallet' => $settingsWallet->getTypes(),
73
- 'Financing' => $settingsFinancing->toArray(),
74
'Safe Invoice' => $settingsSafeInvoice->toArray(),
75
);
76
41
$settingsCreditcard = new Payone_Settings_Configuration_PaymentMethod_CreditCard();
42
$settingsOnlineBankTransfer = new Payone_Settings_Configuration_PaymentMethod_OnlineBankTransfer();
43
$settingsWallet = new Payone_Settings_Configuration_PaymentMethod_Wallet();
44
$settingsSafeInvoice = new Payone_Settings_Configuration_PaymentMethod_Financing();
45
46
$return = array_merge(
47
$settingsCreditcard->getTypes(),
48
$settingsOnlineBankTransfer->getTypes(),
49
$settingsWallet->getTypes(),
50
$settingsSafeInvoice->getTypes()
51
);
52
61
$settingsCreditcard = new Payone_Settings_Configuration_PaymentMethod_CreditCard();
62
$settingsOnlineBankTransfer = new Payone_Settings_Configuration_PaymentMethod_OnlineBankTransfer();
63
$settingsWallet = new Payone_Settings_Configuration_PaymentMethod_Wallet();
64
$settingsSafeInvoice = new Payone_Core_Model_System_Config_SafeInvoiceType();
65
66
$return = array(
67
'Creditcard' => $settingsCreditcard->getTypes(),
68
'Online Bank Transfer' => $settingsOnlineBankTransfer->getTypes(),
69
'Wallet' => $settingsWallet->getTypes(),
70
'Safe Invoice' => $settingsSafeInvoice->toArray(),
71
);
72
app/code/community/Payone/Core/Model/System/Config/PaymentMethodCode.php CHANGED
@@ -39,7 +39,6 @@ class Payone_Core_Model_System_Config_PaymentMethodCode extends Payone_Core_Mode
39
const CREDITCARD = 'payone_creditcard';
40
const CREDITCARD_IFRAME = 'payone_creditcard_iframe';
41
const DEBITPAYMENT = 'payone_debit_payment';
42
- const FINANCING = 'payone_financing';
43
const INVOICE = 'payone_invoice';
44
const SAFEINVOICE = 'payone_safe_invoice';
45
const ONLINEBANKTRANSFER = 'payone_online_bank_transfer';
@@ -59,7 +58,6 @@ class Payone_Core_Model_System_Config_PaymentMethodCode extends Payone_Core_Mode
59
self::CREDITCARD => 'Creditcard',
60
self::CREDITCARD_IFRAME => 'Creditcard Channel Frontend',
61
self::DEBITPAYMENT => 'Debit Payment',
62
- self::FINANCING => 'Financing',
63
self::INVOICE => 'Invoice',
64
self::SAFEINVOICE => 'Safe Invoice',
65
self::ONLINEBANKTRANSFER => 'Online Bank Transfer',
39
const CREDITCARD = 'payone_creditcard';
40
const CREDITCARD_IFRAME = 'payone_creditcard_iframe';
41
const DEBITPAYMENT = 'payone_debit_payment';
42
const INVOICE = 'payone_invoice';
43
const SAFEINVOICE = 'payone_safe_invoice';
44
const ONLINEBANKTRANSFER = 'payone_online_bank_transfer';
58
self::CREDITCARD => 'Creditcard',
59
self::CREDITCARD_IFRAME => 'Creditcard Channel Frontend',
60
self::DEBITPAYMENT => 'Debit Payment',
61
self::INVOICE => 'Invoice',
62
self::SAFEINVOICE => 'Safe Invoice',
63
self::ONLINEBANKTRANSFER => 'Online Bank Transfer',
app/code/community/Payone/Core/Model/System/Config/PaymentMethodType.php CHANGED
@@ -37,7 +37,6 @@ class Payone_Core_Model_System_Config_PaymentMethodType extends Payone_Core_Mode
37
const CREDITCARD = 'creditcard';
38
const CREDITCARD_IFRAME = 'creditcard_iframe';
39
const DEBITPAYMENT = 'debit_payment';
40
- const FINANCING = 'financing';
41
const SAFEINVOICE = 'safe_invoice';
42
const INVOICE = 'invoice';
43
const ONLINEBANKTRANSFER = 'online_bank_transfer';
@@ -57,7 +56,6 @@ class Payone_Core_Model_System_Config_PaymentMethodType extends Payone_Core_Mode
57
self::CREDITCARD => 'Creditcard',
58
self::CREDITCARD_IFRAME => 'Creditcard Channel Frontend',
59
self::DEBITPAYMENT => 'Debit Payment',
60
- self::FINANCING => 'Financing',
61
self::SAFEINVOICE => 'Safe Invoice',
62
self::INVOICE => 'Invoice',
63
self::ONLINEBANKTRANSFER => 'Online Bank Transfer',
37
const CREDITCARD = 'creditcard';
38
const CREDITCARD_IFRAME = 'creditcard_iframe';
39
const DEBITPAYMENT = 'debit_payment';
40
const SAFEINVOICE = 'safe_invoice';
41
const INVOICE = 'invoice';
42
const ONLINEBANKTRANSFER = 'online_bank_transfer';
56
self::CREDITCARD => 'Creditcard',
57
self::CREDITCARD_IFRAME => 'Creditcard Channel Frontend',
58
self::DEBITPAYMENT => 'Debit Payment',
59
self::SAFEINVOICE => 'Safe Invoice',
60
self::INVOICE => 'Invoice',
61
self::ONLINEBANKTRANSFER => 'Online Bank Transfer',
app/code/community/Payone/Core/controllers/Adminhtml/Payonecore/System/ConfigurationController.php CHANGED
@@ -1,106 +1,108 @@
1
- <?php
2
- /**
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the GNU General Public License (GPL 3)
7
- * that is bundled with this package in the file LICENSE.txt
8
- *
9
- * DISCLAIMER
10
- *
11
- * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
- * versions in the future. If you wish to customize Payone_Core for your
13
- * needs please refer to http://www.payone.de for more information.
14
- *
15
- * @category Payone
16
- * @package Payone_Core_controllers
17
- * @subpackage Adminhtml_System
18
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
- * @author Matthias Walter <info@noovias.com>
20
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
- * @link http://www.noovias.com
22
- */
23
-
24
- /**
25
- *
26
- * @category Payone
27
- * @package Payone_Core_controllers
28
- * @subpackage Adminhtml_System
29
- * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
- * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
- * @link http://www.noovias.com
32
- */
33
- class Payone_Core_Adminhtml_Payonecore_System_ConfigurationController
34
- extends Payone_Core_Controller_Adminhtml_Abstract
35
- {
36
- /**
37
- * @return Mage_Core_Controller_Varien_Action
38
- */
39
- public function exportAction()
40
- {
41
- $service = $this->getFactory()->getServiceXmlGenerate();
42
- $configService = $this->getFactory()->getServiceConfigXmlGenerate();
43
- $configXml = $configService->execute();
44
- return $this->_prepareDownloadResponse(
45
- 'payone_config_export' . Mage::getSingleton('core/date')->date('Y-m-d_H-i-s') . '.xml', $configXml,
46
- 'application/xml'
47
- );
48
- }
49
-
50
- /**
51
- * @return Mage_Core_Controller_Varien_Action
52
- */
53
- public function exportOldAction()
54
- {
55
- $config = '';
56
-
57
- $storeId = null;
58
-
59
- $configPaymentCc = Mage::getStoreConfig('payment/payone_cc', $storeId);
60
- $configPaymentElv = Mage::getStoreConfig('payment/payone_elv', $storeId);
61
- $configPaymentVor = Mage::getStoreConfig('payment/payone_vor', $storeId);
62
- $configPaymentRec = Mage::getStoreConfig('payment/payone_rec', $storeId);
63
- $configPaymentCod = Mage::getStoreConfig('payment/payone_cod', $storeId);
64
- $configPaymentSb = Mage::getStoreConfig('payment/payone_sb', $storeId);
65
- $configPaymentWlt = Mage::getStoreConfig('payment/payone_wlt', $storeId);
66
- $configPaymentFnc = Mage::getStoreConfig('payment/payone_fnc', $storeId);
67
- $configPaymentSin = Mage::getStoreConfig('payment/payone_sin', $storeId);
68
-
69
- $configCreditrating = Mage::getStoreConfig('payonecreditrating', $storeId);
70
-
71
- $configPayment = array(
72
- 'payone_cc' => $configPaymentCc,
73
- 'payone_elv' => $configPaymentElv,
74
- 'payone_vor' => $configPaymentVor,
75
- 'payone_rec' => $configPaymentRec,
76
- 'payone_cod' => $configPaymentCod,
77
- 'payone_sb' => $configPaymentSb,
78
- 'payone_wlt' => $configPaymentWlt,
79
- 'payone_fnc' => $configPaymentFnc,
80
- 'payone_sin' => $configPaymentSin
81
- );
82
-
83
- // PAYMENT
84
- foreach ($configPayment as $methodCode => $configMethod) {
85
- $config .= '[' . $methodCode . ']' . "\n";
86
- foreach ($configMethod as $key => $value) {
87
- $config .= $key . ' = ' . $value . "\n";
88
- }
89
- $config .= "\n";
90
- }
91
-
92
- // CREDITRATING
93
- foreach ($configCreditrating as $methodCode => $configMethod) {
94
- $config .= '[' . $methodCode . ']' . "\n";
95
- foreach ($configMethod as $key => $value) {
96
- $config .= $key . ' = ' . $value . "\n";
97
- }
98
- $config .= "\n";
99
- }
100
-
101
- return $this->_prepareDownloadResponse(
102
- 'payone_config_export' . Mage::getSingleton('core/date')->date('Y-m-d_H-i-s') . '.txt', $config,
103
- 'application/text'
104
- );
105
- }
106
}
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_controllers
17
+ * @subpackage Adminhtml_System
18
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
19
+ * @author Matthias Walter <info@noovias.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.noovias.com
22
+ */
23
+
24
+ /**
25
+ *
26
+ * @category Payone
27
+ * @package Payone_Core_controllers
28
+ * @subpackage Adminhtml_System
29
+ * @copyright Copyright (c) 2012 <info@noovias.com> - www.noovias.com
30
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
+ * @link http://www.noovias.com
32
+ */
33
+ class Payone_Core_Adminhtml_Payonecore_System_ConfigurationController
34
+ extends Payone_Core_Controller_Adminhtml_Abstract
35
+ {
36
+ /**
37
+ * @return Mage_Core_Controller_Varien_Action
38
+ */
39
+ public function exportAction()
40
+ {
41
+ $service = $this->getFactory()->getServiceXmlGenerate();
42
+ $configService = $this->getFactory()->getServiceConfigXmlGenerate();
43
+ $configXml = $configService->execute();
44
+ return $this->_prepareDownloadResponse(
45
+ 'payone_config_export' . Mage::getSingleton('core/date')->date('Y-m-d_H-i-s') . '.xml', $configXml,
46
+ 'application/xml'
47
+ );
48
+ }
49
+
50
+ /**
51
+ * @return Mage_Core_Controller_Varien_Action
52
+ */
53
+ public function exportOldAction()
54
+ {
55
+ $config = '';
56
+
57
+ $storeId = null;
58
+
59
+ $configPaymentCc = Mage::getStoreConfig('payment/payone_cc', $storeId);
60
+ $configPaymentElv = Mage::getStoreConfig('payment/payone_elv', $storeId);
61
+ $configPaymentVor = Mage::getStoreConfig('payment/payone_vor', $storeId);
62
+ $configPaymentRec = Mage::getStoreConfig('payment/payone_rec', $storeId);
63
+ $configPaymentCod = Mage::getStoreConfig('payment/payone_cod', $storeId);
64
+ $configPaymentSb = Mage::getStoreConfig('payment/payone_sb', $storeId);
65
+ $configPaymentWlt = Mage::getStoreConfig('payment/payone_wlt', $storeId);
66
+ $configPaymentFnc = Mage::getStoreConfig('payment/payone_fnc', $storeId);
67
+ $configPaymentSin = Mage::getStoreConfig('payment/payone_sin', $storeId);
68
+ $configPaymentCsh = Mage::getStoreConfig('payment/payone_csh', $storeId);
69
+
70
+ $configCreditrating = Mage::getStoreConfig('payonecreditrating', $storeId);
71
+
72
+ $configPayment = array(
73
+ 'payone_cc' => $configPaymentCc,
74
+ 'payone_elv' => $configPaymentElv,
75
+ 'payone_vor' => $configPaymentVor,
76
+ 'payone_rec' => $configPaymentRec,
77
+ 'payone_cod' => $configPaymentCod,
78
+ 'payone_sb' => $configPaymentSb,
79
+ 'payone_wlt' => $configPaymentWlt,
80
+ 'payone_fnc' => $configPaymentFnc,
81
+ 'payone_csh' => $configPaymentCsh,
82
+ 'payone_sin' => $configPaymentSin
83
+ );
84
+
85
+ // PAYMENT
86
+ foreach ($configPayment as $methodCode => $configMethod) {
87
+ $config .= '[' . $methodCode . ']' . "\n";
88
+ foreach ($configMethod as $key => $value) {
89
+ $config .= $key . ' = ' . $value . "\n";
90
+ }
91
+ $config .= "\n";
92
+ }
93
+
94
+ // CREDITRATING
95
+ foreach ($configCreditrating as $methodCode => $configMethod) {
96
+ $config .= '[' . $methodCode . ']' . "\n";
97
+ foreach ($configMethod as $key => $value) {
98
+ $config .= $key . ' = ' . $value . "\n";
99
+ }
100
+ $config .= "\n";
101
+ }
102
+
103
+ return $this->_prepareDownloadResponse(
104
+ 'payone_config_export' . Mage::getSingleton('core/date')->date('Y-m-d_H-i-s') . '.txt', $config,
105
+ 'application/text'
106
+ );
107
+ }
108
}
app/code/community/Payone/Core/etc/config.xml CHANGED
@@ -24,7 +24,7 @@
24
<config>
25
<modules>
26
<Payone_Core>
27
- <version>3.5.4</version>
28
</Payone_Core>
29
</modules>
30
@@ -155,10 +155,6 @@
155
<payone_config_payment_method_id>
156
<to_order_payment>*</to_order_payment>
157
</payone_config_payment_method_id>
158
- <payone_financing_type>
159
- <!-- Financing: Type -->
160
- <to_order_payment>*</to_order_payment>
161
- </payone_financing_type>
162
<payone_safe_invoice_type>
163
<!-- Financing: Type -->
164
<to_order_payment>*</to_order_payment>
@@ -235,6 +231,14 @@
235
<!-- Payolution type -->
236
<to_order_payment>*</to_order_payment>
237
</payone_payolution_type>
238
<payone_isb2b>
239
<!-- B2B mode ? -->
240
<to_order_payment>*</to_order_payment>
@@ -580,11 +584,6 @@
580
<model>payone_core/payment_method_debitPayment</model>
581
<group>payone</group>
582
</payone_debit_payment>
583
- <payone_financing translate="title" module="payone_core">
584
- <title>PAYONE - Financing</title>
585
- <model>payone_core/payment_method_financing</model>
586
- <group>payone</group>
587
- </payone_financing>
588
<payone_safe_invoice translate="title" module="payone_core">
589
<title>PAYONE - Safe Invoice</title>
590
<model>payone_core/payment_method_safeInvoice</model>
@@ -618,17 +617,15 @@
618
<template_debit_payment>
619
<use_global>1</use_global>
620
<check_bankaccount>0</check_bankaccount>
621
<sepa_de_show_bank_data>0</sepa_de_show_bank_data>
622
<sepa_mandate_enabled>1</sepa_mandate_enabled>
623
<sepa_mandate_download_enabled>1</sepa_mandate_download_enabled>
624
</template_debit_payment>
625
<template_online_bank_transfer>
626
<use_global>1</use_global>
627
</template_online_bank_transfer>
628
- <template_financing>
629
- <types>CFR</types>
630
- <use_global>1</use_global>
631
- </template_financing>
632
<template_safe_invoice>
633
<types>BSV</types>
634
<use_global>1</use_global>
@@ -673,13 +670,15 @@
673
<creditcard>a:1:{s:18:"_1343137391927_927";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</creditcard>
674
<invoice>a:1:{s:18:"_1338893611948_948";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</invoice>
675
<debit_payment>a:1:{s:18:"_1338893616379_379";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</debit_payment>
676
- <financing>a:1:{s:23:"_payone_status_mapping2";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</financing>
677
<safe_invoice>a:1:{s:23:"_payone_status_mapping3";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</safe_invoice>
678
<advance_payment>a:2:{s:18:"_1338893618715_715";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:11:"new|pending";}}s:18:"_1355483828815_815";a:2:{s:8:"txaction";a:1:{i:0;s:4:"paid";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</advance_payment>
679
<online_bank_transfer>a:1:{s:18:"_1343118466182_182";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</online_bank_transfer>
680
<cash_on_delivery>a:1:{s:18:"_1338893625332_332";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</cash_on_delivery>
681
<wallet>a:1:{s:18:"_1343137411652_652";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</wallet>
682
<barzahlen>a:1:{s:23:"_payone_status_mapping4";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</barzahlen>
683
</status_mapping>
684
</payone_general>
685
<payone_protect>
24
<config>
25
<modules>
26
<Payone_Core>
27
+ <version>3.6.1</version>
28
</Payone_Core>
29
</modules>
30
155
<payone_config_payment_method_id>
156
<to_order_payment>*</to_order_payment>
157
</payone_config_payment_method_id>
158
<payone_safe_invoice_type>
159
<!-- Financing: Type -->
160
<to_order_payment>*</to_order_payment>
231
<!-- Payolution type -->
232
<to_order_payment>*</to_order_payment>
233
</payone_payolution_type>
234
+ <payone_payolution_iban>
235
+ <!-- Payolution iban -->
236
+ <to_order_payment>*</to_order_payment>
237
+ </payone_payolution_iban>
238
+ <payone_payolution_bic>
239
+ <!-- Payolution bic -->
240
+ <to_order_payment>*</to_order_payment>
241
+ </payone_payolution_bic>
242
<payone_isb2b>
243
<!-- B2B mode ? -->
244
<to_order_payment>*</to_order_payment>
584
<model>payone_core/payment_method_debitPayment</model>
585
<group>payone</group>
586
</payone_debit_payment>
587
<payone_safe_invoice translate="title" module="payone_core">
588
<title>PAYONE - Safe Invoice</title>
589
<model>payone_core/payment_method_safeInvoice</model>
617
<template_debit_payment>
618
<use_global>1</use_global>
619
<check_bankaccount>0</check_bankaccount>
620
+ <sepa_request_bic>0</sepa_request_bic>
621
<sepa_de_show_bank_data>0</sepa_de_show_bank_data>
622
<sepa_mandate_enabled>1</sepa_mandate_enabled>
623
<sepa_mandate_download_enabled>1</sepa_mandate_download_enabled>
624
</template_debit_payment>
625
<template_online_bank_transfer>
626
<use_global>1</use_global>
627
+ <sofortueberweisung_show_iban>0</sofortueberweisung_show_iban>
628
</template_online_bank_transfer>
629
<template_safe_invoice>
630
<types>BSV</types>
631
<use_global>1</use_global>
670
<creditcard>a:1:{s:18:"_1343137391927_927";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</creditcard>
671
<invoice>a:1:{s:18:"_1338893611948_948";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</invoice>
672
<debit_payment>a:1:{s:18:"_1338893616379_379";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</debit_payment>
673
<safe_invoice>a:1:{s:23:"_payone_status_mapping3";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</safe_invoice>
674
<advance_payment>a:2:{s:18:"_1338893618715_715";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:11:"new|pending";}}s:18:"_1355483828815_815";a:2:{s:8:"txaction";a:1:{i:0;s:4:"paid";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</advance_payment>
675
<online_bank_transfer>a:1:{s:18:"_1343118466182_182";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</online_bank_transfer>
676
<cash_on_delivery>a:1:{s:18:"_1338893625332_332";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</cash_on_delivery>
677
<wallet>a:1:{s:18:"_1343137411652_652";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</wallet>
678
<barzahlen>a:1:{s:23:"_payone_status_mapping4";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</barzahlen>
679
+ <ratepay>a:1:{s:17:"_1468417699073_73";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</ratepay>
680
+ <payolution>a:1:{s:18:"_1468430772551_551";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</payolution>
681
+ <financing>a:1:{s:18:"_1468430123551_512";a:2:{s:8:"txaction";a:1:{i:0;s:9:"appointed";}s:12:"state_status";a:1:{i:0;s:21:"processing|processing";}}}</financing>
682
</status_mapping>
683
</payone_general>
684
<payone_protect>
app/code/community/Payone/Core/etc/system.xml CHANGED
@@ -274,15 +274,6 @@
274
<show_in_website>1</show_in_website>
275
<show_in_store>1</show_in_store>
276
</safe_invoice>
277
- <financing translate="label">
278
- <label>Financing</label>
279
- <frontend_model>payone_core/adminhtml_system_config_form_field_statusMapping</frontend_model>
280
- <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
281
- <sort_order>20</sort_order>
282
- <show_in_default>1</show_in_default>
283
- <show_in_website>1</show_in_website>
284
- <show_in_store>1</show_in_store>
285
- </financing>
286
<debit_payment translate="label">
287
<label>Debit Payment</label>
288
<frontend_model>payone_core/adminhtml_system_config_form_field_statusMapping</frontend_model>
@@ -337,6 +328,33 @@
337
<show_in_website>1</show_in_website>
338
<show_in_store>1</show_in_store>
339
</barzahlen>
340
</fields>
341
</status_mapping>
342
<payment_creditcard>
@@ -770,6 +788,15 @@
770
<show_in_website>1</show_in_website>
771
<show_in_store>1</show_in_store>
772
</sepa_country>
773
<sepa_de_show_bank_data translate="label,comment">
774
<label>Show additional account number/bank code number</label>
775
<comment>Only for German accounts</comment>
@@ -837,6 +864,15 @@
837
<show_in_website>1</show_in_website>
838
<show_in_store>1</show_in_store>
839
</customer_form_data_save>
840
</fields>
841
</template_online_bank_transfer>
842
<template_invoice translate="label" module="payone_core">
@@ -877,71 +913,6 @@
877
</klarna_config>
878
</fields>
879
</template_safe_invoice>
880
- <template_financing translate="label" module="payone_core">
881
- <label>Financing</label>
882
- <frontend_type>text</frontend_type>
883
- <sort_order>5</sort_order>
884
- <show_in_default>1</show_in_default>
885
- <show_in_website>1</show_in_website>
886
- <show_in_store>1</show_in_store>
887
- <fields>
888
- <min_order_total translate="label, comment">
889
- <label>Minimum Order Total</label>
890
- <comment>Please note that for Commerz Finanz the maximum transaction amount is EUR5000.00.</comment>
891
- <frontend_type>text</frontend_type>
892
- <sort_order>55</sort_order>
893
- <show_in_default>1</show_in_default>
894
- <show_in_website>1</show_in_website>
895
- <show_in_store>1</show_in_store>
896
- </min_order_total>
897
- <max_order_total translate="label, comment">
898
- <label>Maximum Order Total</label>
899
- <comment>Please note that for Commerz Finanz the minimum transaction amount is EUR100.00.</comment>
900
- <frontend_type>text</frontend_type>
901
- <sort_order>58</sort_order>
902
- <show_in_default>1</show_in_default>
903
- <show_in_website>1</show_in_website>
904
- <show_in_store>1</show_in_store>
905
- </max_order_total>
906
- <types translate="label,comment">
907
- <label>Financing-Type</label>
908
- <frontend_type>multiselect</frontend_type>
909
- <source_model>payone_core/system_config_financingType</source_model>
910
- <sort_order>200</sort_order>
911
- <show_in_default>1</show_in_default>
912
- <show_in_website>1</show_in_website>
913
- <show_in_store>1</show_in_store>
914
- </types>
915
- <klarna_config translate="label">
916
- <label>Klarna Store-IDs</label>
917
- <comment>Required when using Klarna</comment>
918
- <frontend_model>payone_core/adminhtml_system_config_form_field_klarnaStoreId</frontend_model>
919
- <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
920
- <sort_order>210</sort_order>
921
- <show_in_default>1</show_in_default>
922
- <show_in_website>1</show_in_website>
923
- <show_in_store>1</show_in_store>
924
- </klarna_config>
925
- <klarna_campaign_code translate="label, comment">
926
- <label>Klarna Campaign Code</label>
927
- <frontend_type>text</frontend_type>
928
- <sort_order>220</sort_order>
929
- <show_in_default>1</show_in_default>
930
- <show_in_website>1</show_in_website>
931
- <show_in_store>1</show_in_store>
932
- </klarna_campaign_code>
933
- <request_type_cfr translate="label">
934
- <label>Authorize-Method</label>
935
- <comment>Please note that for Commerz Finanz only the mode "preauthorization" is available. Afterwards payments must be captured. (CAPTURE)</comment>
936
- <frontend_type>select</frontend_type>
937
- <source_model>payone_core/system_config_authorizeMethodFinancing</source_model>
938
- <sort_order>230</sort_order>
939
- <show_in_default>1</show_in_default>
940
- <show_in_website>1</show_in_website>
941
- <show_in_store>1</show_in_store>
942
- </request_type_cfr>
943
- </fields>
944
- </template_financing>
945
<template_wallet translate="label" module="payone_core">
946
<label>Wallet</label>
947
<frontend_type>text</frontend_type>
274
<show_in_website>1</show_in_website>
275
<show_in_store>1</show_in_store>
276
</safe_invoice>
277
<debit_payment translate="label">
278
<label>Debit Payment</label>
279
<frontend_model>payone_core/adminhtml_system_config_form_field_statusMapping</frontend_model>
328
<show_in_website>1</show_in_website>
329
<show_in_store>1</show_in_store>
330
</barzahlen>
331
+ <payolution translate="label">
332
+ <label>Payolution</label>
333
+ <frontend_model>payone_core/adminhtml_system_config_form_field_statusMapping</frontend_model>
334
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
335
+ <sort_order>90</sort_order>
336
+ <show_in_default>1</show_in_default>
337
+ <show_in_website>1</show_in_website>
338
+ <show_in_store>1</show_in_store>
339
+ </payolution>
340
+ <ratepay translate="label">
341
+ <label>RatePay</label>
342
+ <frontend_model>payone_core/adminhtml_system_config_form_field_statusMapping</frontend_model>
343
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
344
+ <sort_order>100</sort_order>
345
+ <show_in_default>1</show_in_default>
346
+ <show_in_website>1</show_in_website>
347
+ <show_in_store>1</show_in_store>
348
+ </ratepay>
349
+ <financing translate="label">
350
+ <label>Finanzierung</label>
351
+ <frontend_model>payone_core/adminhtml_system_config_form_field_statusMapping</frontend_model>
352
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
353
+ <sort_order>110</sort_order>
354
+ <show_in_default>1</show_in_default>
355
+ <show_in_website>1</show_in_website>
356
+ <show_in_store>1</show_in_store>
357
+ </financing>
358
</fields>
359
</status_mapping>
360
<payment_creditcard>
788
<show_in_website>1</show_in_website>
789
<show_in_store>1</show_in_store>
790
</sepa_country>
791
+ <sepa_request_bic translate="label">
792
+ <label>Request BIC</label>
793
+ <frontend_type>select</frontend_type>
794
+ <source_model>adminhtml/system_config_source_yesno</source_model>
795
+ <sort_order>235</sort_order>
796
+ <show_in_default>1</show_in_default>
797
+ <show_in_website>1</show_in_website>
798
+ <show_in_store>1</show_in_store>
799
+ </sepa_request_bic>
800
<sepa_de_show_bank_data translate="label,comment">
801
<label>Show additional account number/bank code number</label>
802
<comment>Only for German accounts</comment>
864
<show_in_website>1</show_in_website>
865
<show_in_store>1</show_in_store>
866
</customer_form_data_save>
867
+ <sofortueberweisung_show_iban translate="label">
868
+ <label>Sofort-Ueberweisung: Display IBAN/BIC inputs</label>
869
+ <frontend_type>select</frontend_type>
870
+ <source_model>adminhtml/system_config_source_yesno</source_model>
871
+ <sort_order>280</sort_order>
872
+ <show_in_default>1</show_in_default>
873
+ <show_in_website>1</show_in_website>
874
+ <show_in_store>1</show_in_store>
875
+ </sofortueberweisung_show_iban>
876
</fields>
877
</template_online_bank_transfer>
878
<template_invoice translate="label" module="payone_core">
913
</klarna_config>
914
</fields>
915
</template_safe_invoice>
916
<template_wallet translate="label" module="payone_core">
917
<label>Wallet</label>
918
<frontend_type>text</frontend_type>
app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.5.10-3.6.0.php ADDED
@@ -0,0 +1,59 @@
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_Block
17
+ * @subpackage Payment
18
+ * @copyright Copyright (c) 2016 <kontakt@fatchip.de> - www.fatchip.com
19
+ * @author Robert M�ller <robert.mueller@fatchip.de>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.fatchip.com
22
+ */
23
+
24
+ /** @var $this Mage_Core_Model_Resource_Setup */
25
+ /** @var $installer Mage_Core_Model_Resource_Setup */
26
+
27
+ $installer = $this;
28
+ $installer->startSetup();
29
+
30
+ $tableQuoteAddress = $this->getTable('sales/quote_address');
31
+
32
+ /** @var $helper Payone_Core_Helper_Data */
33
+ $helper = Mage::helper('payone_core');
34
+ $useSqlInstaller = $helper->mustUseSqlInstaller();
35
+
36
+ if ($useSqlInstaller) {
37
+ $sql = file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'upgrade-3.5.10-3.6.0.sql');
38
+
39
+ $installSqlConfig = array(
40
+ '{{sales_flat_quote_address}}' => $tableQuoteAddress,
41
+ );
42
+
43
+ $installSql = str_replace(array_keys($installSqlConfig), array_values($installSqlConfig), $sql);
44
+ $installer->run($installSql);
45
+ } else {
46
+ $connection = $installer->getConnection();
47
+
48
+ $connection->addColumn($tableQuoteAddress, 'payone_payment_fee',
49
+ array(
50
+ 'TYPE' => Varien_Db_Ddl_Table::TYPE_FLOAT,
51
+ 'NULLABLE' => true,
52
+ 'COMMENT' => 'payone_payment_fee'
53
+ ));
54
+
55
+ }
56
+ $installer->endSetup();
57
+
58
+
59
+
app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.5.6-3.5.7.php ADDED
@@ -0,0 +1,87 @@
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_Block
17
+ * @subpackage Payment
18
+ * @copyright Copyright (c) 2016 <kontakt@fatchip.de> - www.fatchip.com
19
+ * @author Robert M�ller <robert.mueller@fatchip.de>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.fatchip.com
22
+ */
23
+
24
+ /** @var $this Mage_Core_Model_Resource_Setup */
25
+ /** @var $installer Mage_Core_Model_Resource_Setup */
26
+
27
+ $installer = $this;
28
+ $installer->startSetup();
29
+
30
+ $tablePaymentMethod = $this->getTable('payone_core/config_payment_method');
31
+ $tableSalesOrderPayment = $this->getTable('sales/order_payment');
32
+ $tableSalesQuotePayment = $this->getTable('sales/quote_payment');
33
+
34
+ /** @var $helper Payone_Core_Helper_Data */
35
+ $helper = Mage::helper('payone_core');
36
+ $useSqlInstaller = $helper->mustUseSqlInstaller();
37
+
38
+ if ($useSqlInstaller) {
39
+ $sql = file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'upgrade-3.5.6-3.5.7.sql');
40
+
41
+ $installSqlConfig = array(
42
+ '{{payone_config_payment_method}}' => $tablePaymentMethod,
43
+ '{{sales_flat_order_payment}}' => $tableSalesOrderPayment,
44
+ '{{sales_flat_quote_payment}}' => $tableSalesQuotePayment,
45
+ );
46
+
47
+ $installSql = str_replace(array_keys($installSqlConfig), array_values($installSqlConfig), $sql);
48
+ $installer->run($installSql);
49
+ } else {
50
+ $connection = $installer->getConnection();
51
+ $connection->addColumn($tablePaymentMethod, 'sofortueberweisung_show_iban',
52
+ array(
53
+ 'TYPE' => Varien_Db_Ddl_Table::TYPE_BOOLEAN,
54
+ 'NULLABLE' => true,
55
+ 'DEFAULT' => NULL,
56
+ 'COMMENT' => 'sofortueberweisung_show_iban')
57
+ );
58
+ $connection->addColumn($tablePaymentMethod, 'sepa_request_bic',
59
+ array(
60
+ 'TYPE' => Varien_Db_Ddl_Table::TYPE_BOOLEAN,
61
+ 'NULLABLE' => true,
62
+ 'DEFAULT' => NULL,
63
+ 'COMMENT' => 'sepa_request_bic')
64
+ );
65
+
66
+ // Update table sales_flat_order_payment
67
+ $connection->addColumn($tableSalesOrderPayment, 'payone_payolution_bic',
68
+ 'VARCHAR(11) COMMENT \'PAYOLUTION BIC\' AFTER `payone_sepa_bic`'
69
+ );
70
+
71
+ $connection->addColumn($tableSalesOrderPayment, 'payone_payolution_iban',
72
+ 'VARCHAR(34) COMMENT \'PAYOLUTION IBAN\' AFTER `payone_sepa_bic`'
73
+ );
74
+
75
+ // Update table sales_flat_quote_payment
76
+ $connection->addColumn($tableSalesQuotePayment, 'payone_payolution_bic',
77
+ 'VARCHAR(11) COMMENT \'PAYOLUTION BIC\' AFTER `payone_sepa_bic`'
78
+ );
79
+
80
+ $connection->addColumn($tableSalesQuotePayment, 'payone_payolution_iban',
81
+ 'VARCHAR(34) COMMENT \'PAYOLUTION IBAN\' AFTER `payone_sepa_bic`'
82
+ );
83
+
84
+ }
85
+ $installer->endSetup();
86
+
87
+
app/code/community/Payone/Core/sql/payone_core_setup/upgrade-3.5.10-3.6.0.sql ADDED
@@ -0,0 +1,6 @@