Mage_Payone - Version 3.3.0

Version Notes

Mage_Payone-3.2.0

Download this release

Release Info

Developer PAYONE
Extension Mage_Payone
Version 3.3.0
Comparing to
See all releases


Code changes from version 3.2.0 to 3.3.0

Files changed (107) hide show
  1. app/code/community/Payone/Core/Block/Adminhtml/System/Config/Form/Field/Info.php +1 -1
  2. app/code/community/Payone/Core/Block/Adminhtml/System/Config/Hint.php +1 -1
  3. app/code/community/Payone/Core/Block/Payment/Method/Form/Abstract.php +27 -0
  4. app/code/community/Payone/Core/Block/Payment/Method/Form/Creditcard.php +71 -7
  5. app/code/community/Payone/Core/Block/Payment/Method/Form/DebitPayment.php +6 -2
  6. app/code/community/Payone/Core/Block/Payment/Method/Form/Financing.php +40 -5
  7. app/code/community/Payone/Core/Block/Payment/Method/Form/Financing/Klarna.php +271 -0
  8. app/code/community/Payone/Core/Block/Payment/Method/Form/OnlineBankTransfer.php +1 -0
  9. app/code/community/Payone/Core/Block/Payment/Method/Info/Abstract.php +9 -0
  10. app/code/community/Payone/Core/Model/Config/Payment/Method.php +41 -1
  11. app/code/community/Payone/Core/Model/Config/Payment/Method/Interface.php +20 -0
  12. app/code/community/Payone/Core/Model/Domain/Customer.php +103 -0
  13. app/code/community/Payone/Core/Model/Domain/Protocol/Api.php +1 -1
  14. app/code/community/Payone/Core/Model/Domain/Resource/Customer.php +44 -0
  15. app/code/community/Payone/Core/Model/Domain/Resource/Customer/Collection.php +45 -0
  16. app/code/community/Payone/Core/Model/Handler/Verification/AddressCheck.php +8 -3
  17. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Management/GetFile.php +1 -1
  18. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Management/GetInvoice.php +1 -1
  19. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Management/ManageMandate.php +1 -1
  20. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Abstract.php +6 -3
  21. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Authorize/Abstract.php +20 -0
  22. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Capture.php +3 -2
  23. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Debit.php +0 -5
  24. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/AddressCheck.php +1 -1
  25. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/BankAccountCheck.php +1 -1
  26. app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/Creditrating.php +1 -1
  27. app/code/community/Payone/Core/Model/Observer/Checkout/Onepage/DebitPayment.php +22 -11
  28. app/code/community/Payone/Core/Model/Observer/Checkout/Onepage/Payment/Methods.php +8 -0
  29. app/code/community/Payone/Core/Model/Observer/Sales/Order.php +62 -0
  30. app/code/community/Payone/Core/Model/Service/Management/ManageMandate.php +3 -4
  31. app/code/community/Payone/Core/Model/System/Config/FinancingType.php +17 -10
  32. app/code/community/Payone/Core/etc/config.xml +28 -4
  33. app/code/community/Payone/Core/etc/system.xml +52 -7
  34. app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.2.1-3.2.2.php +102 -0
  35. app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.2.2-3.2.3.php +54 -0
  36. app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.2.3-3.3.0.php +39 -0
  37. app/code/community/Payone/Core/sql/payone_core_setup/upgrade-3.2.1-3.2.2.sql +18 -0
  38. app/code/community/Payone/Core/sql/payone_core_setup/upgrade-3.2.2-3.2.3.sql +6 -0
  39. app/code/community/Payone/Licensemanager/Block/Adminhtml/Notification/Toolbar.php +34 -0
  40. app/code/community/Payone/Licensemanager/Block/Adminhtml/Notification/Window.php +82 -0
  41. app/code/community/Payone/Licensemanager/Helper/Data.php +99 -0
  42. app/code/community/Payone/Licensemanager/Model/Observer.php +55 -0
  43. app/code/community/Payone/Licensemanager/controllers/ActiveController.php +45 -0
  44. app/code/community/Payone/Licensemanager/controllers/Adminhtml/TestController.php +41 -0
  45. app/code/community/Payone/Licensemanager/etc/config.xml +91 -0
  46. app/design/adminhtml/default/default/layout/payone/licensemanager.xml +33 -0
  47. app/design/adminhtml/default/default/template/payone/core/system/config/hint/payment.phtml +25 -25
  48. app/design/adminhtml/default/default/template/payone/core/system/config/hint/protect.phtml +7 -12
  49. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/general/global.phtml +19 -20
  50. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/general/narrative_text.phtml +5 -7
  51. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/general/parameter_invoice.phtml +35 -41
  52. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/general/payment_creditcard.phtml +3 -4
  53. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/general/status_mapping.phtml +25 -29
  54. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/creditmemo.phtml +5 -5
  55. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/discount.phtml +5 -5
  56. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/email_avs.phtml +23 -25
  57. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/email_error.phtml +14 -15
  58. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/shipping_costs.phtml +4 -5
  59. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/transaction_status_forwarding.phtml +5 -5
  60. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/transactionstatus_forwarding.phtml +20 -21
  61. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/misc/transactionstatus_processing.phtml +11 -11
  62. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/creditcard.phtml +15 -15
  63. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/debit_payment.phtml +6 -10
  64. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/financing.phtml +3 -3
  65. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/method.phtml +37 -40
  66. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/online_bank_transfer.phtml +9 -9
  67. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/safe_invoice.phtml +4 -3
  68. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/payment/wallet.phtml +3 -3
  69. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/protect/addresscheck.phtml +54 -71
  70. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/protect/addresscheck_type.phtml +5 -9
  71. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/protect/creditrating.phtml +67 -82
  72. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/protect/creditrating_agreement_message.phtml +12 -4
  73. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/protect/creditrating_lifetime.phtml +3 -4
  74. app/design/adminhtml/default/default/template/payone/core/system/config/tooltip/protect/creditrating_type.phtml +6 -22
  75. app/design/adminhtml/default/default/template/payone/licensemanager/toolbar.phtml +29 -0
  76. app/design/adminhtml/default/default/template/payone/licensemanager/window.phtml +69 -0
  77. app/design/frontend/base/default/template/payone/core/payment/method/form/creditcard.phtml +14 -7
  78. app/design/frontend/base/default/template/payone/core/payment/method/form/debitpayment.phtml +22 -15
  79. app/design/frontend/base/default/template/payone/core/payment/method/form/financing.phtml +6 -0
  80. app/design/frontend/base/default/template/payone/core/payment/method/form/financing/klarna.phtml +173 -0
  81. app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfer.phtml +24 -10
  82. app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfer/bankgroup.phtml +32 -32
  83. app/design/frontend/base/default/template/payone/core/payment/method/form/safe_invoice/klarna.phtml +4 -4
  84. app/design/frontend/base/default/template/payone/core/payment/method/info/debitpayment.phtml +1 -1
  85. app/design/frontend/base/default/template/payone/core/payment/method/info/onlinebanktransfer.phtml +1 -1
  86. app/etc/modules/Payone_Licensemanager.xml +31 -0
  87. app/locale/de_DE/Payone_Core.csv +407 -2
  88. app/locale/de_DE/Payone_Licensemanager.csv +2 -0
  89. app/locale/en_US/Payone_Core.csv +3 -1
  90. app/locale/en_US/Payone_Licensemanager.csv +2 -0
  91. js/payone/core/creditcard.js +12 -0
  92. js/payone/core/debitpayment.js +6 -0
  93. js/payone/core/financing.js +13 -1
  94. js/payone/core/klarna.js +7 -2
  95. js/payone/core/onlinebanktransfer.js +6 -0
  96. js/payone/core/sepa_input.js +20 -0
  97. lib/Payone/Api/Enum/FinancingType.php +1 -0
  98. lib/Payone/Api/Enum/OnlinebanktransferType.php +1 -0
  99. lib/Payone/Api/Request/Capture.php +21 -0
  100. lib/Payone/Api/Request/Debit.php +21 -0
  101. lib/Payone/Api/Request/Parameter/Abstract.php +6 -0
  102. lib/Payone/Api/Request/Parameter/Authorization/PaymentMethod/Financing.php +16 -0
  103. lib/Payone/Api/Request/Parameter/Paydata/DataItem.php +85 -0
  104. lib/Payone/Api/Request/Parameter/Paydata/Paydata.php +79 -0
  105. lib/Payone/Api/Request/Refund.php +21 -0
  106. package.xml +7 -23
  107. skin/frontend/default/default/payone/core/mandate.css +37 -0
app/code/community/Payone/Core/Block/Adminhtml/System/Config/Form/Field/Info.php CHANGED
@@ -65,7 +65,7 @@ class Payone_Core_Block_Adminhtml_System_Config_Form_Field_Info
65
protected function getHintText()
66
{
67
$text = $this->helper('payone_core')
68
- ->__('Klicken Sie hier um weitere Informationen zu diesem Bereich zu erhalten');
69
return $text;
70
}
71
}
65
protected function getHintText()
66
{
67
$text = $this->helper('payone_core')
68
+ ->__('Click here to obtain more information on this section');
69
return $text;
70
}
71
}
app/code/community/Payone/Core/Block/Adminhtml/System/Config/Hint.php CHANGED
@@ -77,7 +77,7 @@ class Payone_Core_Block_Adminhtml_System_Config_Hint
77
protected function getHintText()
78
{
79
$text = $this->helper('payone_core')
80
- ->__('Klicken Sie hier um weitere Informationen zu diesem Bereich zu erhalten');
81
return $text;
82
}
83
77
protected function getHintText()
78
{
79
$text = $this->helper('payone_core')
80
+ ->__('Click here to obtain more information on this section');
81
return $text;
82
}
83
app/code/community/Payone/Core/Block/Payment/Method/Form/Abstract.php CHANGED
@@ -259,4 +259,31 @@ class Payone_Core_Block_Payment_Method_Form_Abstract
259
}
260
return $this->factory;
261
}
262
}
259
}
260
return $this->factory;
261
}
262
+
263
+ /**
264
+ * @param string $key
265
+ * @return string
266
+ */
267
+ public function getSavedCustomerData($key)
268
+ {
269
+ $paymentConfig = $this->getPaymentConfig();
270
+ if(Mage::getSingleton('customer/session')->isLoggedIn() && $paymentConfig->getCustomerFormDataSave()) {
271
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
272
+ $paymentCustomerModel = Mage::getModel('payone_core/domain_customer')->loadByCustomerIdPaymentCode($customerId, $this->getMethodCode());
273
+ if($keyData = $paymentCustomerModel->getCustomerData($key)) {
274
+ return $keyData;
275
+ }
276
+ }
277
+ return '';
278
+ }
279
+
280
+ /**
281
+ * @param string $text
282
+ * @return string
283
+ */
284
+ public function strToXXX(string $text) {
285
+ $result = str_repeat('x', strlen($text) - 8);
286
+ $result = substr($text, 0, 4).$result.substr($text, -4);
287
+ return $result;
288
+ }
289
}
app/code/community/Payone/Core/Block/Payment/Method/Form/Creditcard.php CHANGED
@@ -47,9 +47,13 @@ class Payone_Core_Block_Payment_Method_Form_Creditcard
47
*/
48
public function getBillingName()
49
{
50
- $quote = $this->getQuote();
51
- $address = $quote->getBillingAddress();
52
- return $address->getFirstname() . ' ' . $address->getLastname();
53
}
54
55
/**
@@ -82,7 +86,29 @@ class Payone_Core_Block_Payment_Method_Form_Creditcard
82
*/
83
public function getCreditCardType()
84
{
85
- return $this->getInfoData('cc_type');
86
}
87
88
/**
@@ -90,7 +116,10 @@ class Payone_Core_Block_Payment_Method_Form_Creditcard
90
*/
91
public function getCreditCardExpireYear()
92
{
93
- $ccExpYear = $this->getInfoData('cc_exp_year');
94
return $ccExpYear;
95
}
96
@@ -99,10 +128,45 @@ class Payone_Core_Block_Payment_Method_Form_Creditcard
99
*/
100
public function getCreditCardExpireMonth()
101
{
102
- $ccExpMonth = $this->getInfoData('cc_exp_month');
103
return $ccExpMonth;
104
}
105
106
107
/**
108
* Retrieve credit card expire months
@@ -189,7 +253,7 @@ class Payone_Core_Block_Payment_Method_Form_Creditcard
189
'encoding' => 'UTF-8',
190
'language' => $language,
191
'solution_version' => $helper->getPayoneVersion(),
192
- 'solution_name' => 'noovias',
193
'integrator_version' => $helper->getMagentoVersion(),
194
'integrator_name' => 'Magento',
195
'storecarddata' => 'yes',
47
*/
48
public function getBillingName()
49
{
50
+ $billingName = $this->getSavedCustomerData('cc_owner');
51
+ if(empty($billingName)) {
52
+ $quote = $this->getQuote();
53
+ $address = $quote->getBillingAddress();
54
+ $billingName = $address->getFirstname() . ' ' . $address->getLastname();
55
+ }
56
+ return $billingName;
57
}
58
59
/**
86
*/
87
public function getCreditCardType()
88
{
89
+ $creditCardType = $this->getSavedCustomerData('cc_type');
90
+ if(empty($creditCardType)) {
91
+ $creditCardType = $this->getInfoData('cc_type');
92
+ }
93
+ return $creditCardType;
94
+ }
95
+
96
+ /**
97
+ * @return string
98
+ */
99
+ public function getPayoneConfigPaymentMethodId()
100
+ {
101
+ $payoneConfigPaymentMethodId = $this->getSavedCustomerData('payone_config_payment_method_id');
102
+ return $payoneConfigPaymentMethodId;
103
+ }
104
+
105
+ /**
106
+ * @return string
107
+ */
108
+ public function getCreditCardNumberEnc()
109
+ {
110
+ $creditCardNumberEnc = $this->getSavedCustomerData('cc_number_enc');
111
+ return $creditCardNumberEnc;
112
}
113
114
/**
116
*/
117
public function getCreditCardExpireYear()
118
{
119
+ $ccExpYear = $this->getSavedCustomerData('cc_exp_year');
120
+ if(empty($ccExpYear)) {
121
+ $ccExpYear = $this->getInfoData('cc_exp_year');
122
+ }
123
return $ccExpYear;
124
}
125
128
*/
129
public function getCreditCardExpireMonth()
130
{
131
+ $ccExpMonth = $this->getSavedCustomerData('cc_exp_month');
132
+ if(empty($ccExpMonth)) {
133
+ $ccExpMonth = $this->getInfoData('cc_exp_month');
134
+ }
135
return $ccExpMonth;
136
}
137
138
+ /**
139
+ * @return string
140
+ */
141
+ public function getPayonePseudocardpan()
142
+ {
143
+ $payonePseudocardpan = $this->getSavedCustomerData('payone_pseudocardpan');
144
+ return $payonePseudocardpan;
145
+ }
146
+
147
+ /**
148
+ * @return string
149
+ */
150
+ public function getCreditCardCid()
151
+ {
152
+ $creditCardNumberEnc = $this->getSavedCustomerData('cc_number_enc');
153
+ if(empty($creditCardNumberEnc)) {
154
+ return '';
155
+ }
156
+ return 'xxx';
157
+ }
158
+
159
+ /**
160
+ * @return integer
161
+ */
162
+ public function getPayoneCreditCardCheckValidation()
163
+ {
164
+ $creditCardNumberEnc = $this->getSavedCustomerData('cc_number_enc');
165
+ if(empty($creditCardNumberEnc)) {
166
+ return 1;
167
+ }
168
+ return 0;
169
+ }
170
171
/**
172
* Retrieve credit card expire months
253
'encoding' => 'UTF-8',
254
'language' => $language,
255
'solution_version' => $helper->getPayoneVersion(),
256
+ 'solution_name' => 'votum',
257
'integrator_version' => $helper->getMagentoVersion(),
258
'integrator_name' => 'Magento',
259
'storecarddata' => 'yes',
app/code/community/Payone/Core/Block/Payment/Method/Form/DebitPayment.php CHANGED
@@ -53,8 +53,12 @@ class Payone_Core_Block_Payment_Method_Form_DebitPayment
53
*/
54
public function getCountry()
55
{
56
- $quote = $this->getQuote();
57
- return $quote->getBillingAddress()->getCountry();
58
}
59
60
/**
53
*/
54
public function getCountry()
55
{
56
+ $country = $this->getSavedCustomerData('payone_bank_country');
57
+ if(empty($country)) {
58
+ $quote = $this->getQuote();
59
+ $country = $quote->getBillingAddress()->getCountry();
60
+ }
61
+ return $country;
62
}
63
64
/**
app/code/community/Payone/Core/Block/Payment/Method/Form/Financing.php CHANGED
@@ -15,10 +15,10 @@
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
/**
@@ -26,9 +26,9 @@
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_Form_Financing
34
extends Payone_Core_Block_Payment_Method_Form_Abstract
@@ -58,4 +58,39 @@ class Payone_Core_Block_Payment_Method_Form_Financing
58
{
59
return $this->getFactory()->getModelSystemConfigFinancingType()->toSelectArray();
60
}
61
}
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
/**
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
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 ADDED
@@ -0,0 +1,271 @@
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
+ return $options;
191
+ }
192
+
193
+ /**
194
+ * @return bool
195
+ */
196
+ public function isPersonalidRequired()
197
+ {
198
+ $country = $this->getCountry();
199
+ // mandatory for Denmark (DK), Finland(FI), Norway (NO) and Sweden (SE)
200
+ if ($country == 'DK' or $country == 'FI' or $country == 'NO' or $country == 'SE') {
201
+ return true;
202
+ }
203
+ return false;
204
+ }
205
+
206
+ /**
207
+ * @return bool
208
+ */
209
+ public function isShippingAddressAdditionRequired()
210
+ {
211
+ $shippingAddress = $this->getQuote()->getShippingAddress();
212
+ $country = $shippingAddress->getCountry();
213
+ // required only for Netherlands (NL)
214
+ if ($country != 'NL') {
215
+ return false;
216
+ }
217
+
218
+ $addressAdditionShipping = $shippingAddress->getStreet(2);
219
+ if (empty($addressAdditionShipping)) {
220
+ return true;
221
+ }
222
+
223
+ return false;
224
+ }
225
+
226
+ public function isBillingAddressAdditionRequired()
227
+ {
228
+ $billingAddress = $this->getQuote()->getBillingAddress();
229
+ $country = $billingAddress->getCountry();
230
+ // required only for Netherlands (NL)
231
+ if ($country != 'NL') {
232
+ return false;
233
+ }
234
+ $addressAdditionBilling = $billingAddress->getStreet(2);
235
+ if (empty($addressAdditionBilling)) {
236
+ return true;
237
+ }
238
+ return false;
239
+ }
240
+
241
+ /**
242
+ * @return bool
243
+ */
244
+ public function canShowAdditionalFields()
245
+ {
246
+ $country = $this->getCountry();
247
+ if (empty($country)) {
248
+ return false;
249
+ }
250
+ return true;
251
+ }
252
+
253
+ /**
254
+ * @param \Payone_Core_Model_Factory $factory
255
+ */
256
+ public function setFactory(Payone_Core_Model_Factory $factory)
257
+ {
258
+ $this->factory = $factory;
259
+ }
260
+
261
+ /**
262
+ * @return \Payone_Core_Model_Factory
263
+ */
264
+ public function getFactory()
265
+ {
266
+ if ($this->factory === null) {
267
+ $this->factory = new Payone_Core_Model_Factory();
268
+ }
269
+ return $this->factory;
270
+ }
271
+ }
app/code/community/Payone/Core/Block/Payment/Method/Form/OnlineBankTransfer.php CHANGED
@@ -75,6 +75,7 @@ class Payone_Core_Block_Payment_Method_Form_OnlineBankTransfer
75
$block = $this->getLayout()->createBlock('core/template');
76
$block->setTemplate('payone/core/payment/method/form/onlinebanktransfer/bankgroup.phtml');
77
$block->setMethodCode($this->getMethodCode());
78
$html = $block->toHtml();
79
return $html;
80
}
75
$block = $this->getLayout()->createBlock('core/template');
76
$block->setTemplate('payone/core/payment/method/form/onlinebanktransfer/bankgroup.phtml');
77
$block->setMethodCode($this->getMethodCode());
78
+ $block->setSavedCustomerBankGroup($this->getSavedCustomerData('payone_bank_group'));
79
$html = $block->toHtml();
80
return $html;
81
}
app/code/community/Payone/Core/Block/Payment/Method/Info/Abstract.php CHANGED
@@ -112,4 +112,13 @@ class Payone_Core_Block_Payment_Method_Info_Abstract
112
return $this->factory;
113
}
114
115
}
112
return $this->factory;
113
}
114
115
+ /**
116
+ * @param string $text
117
+ * @return string
118
+ */
119
+ public function strToXXX(string $text) {
120
+ $result = str_repeat('x', strlen($text) - 8);
121
+ $result = substr($text, 0, 4).$result.substr($text, -4);
122
+ return $result;
123
+ }
124
}
app/code/community/Payone/Core/Model/Config/Payment/Method.php CHANGED
@@ -121,6 +121,11 @@ class Payone_Core_Model_Config_Payment_Method
121
*/
122
protected $klarna_config = array();
123
124
/**
125
* @var int
126
*/
@@ -152,7 +157,10 @@ class Payone_Core_Model_Config_Payment_Method
152
* @var int
153
*/
154
protected $sepa_mandate_download_enabled = 1;
155
-
156
/**
157
* @var int
158
*/
@@ -469,6 +477,22 @@ class Payone_Core_Model_Config_Payment_Method
469
return $this->klarna_config;
470
}
471
472
/**
473
* @param int $mid
474
*/
@@ -816,6 +840,22 @@ class Payone_Core_Model_Config_Payment_Method
816
return $this->sepa_mandate_download_enabled;
817
}
818
819
/**
820
* @param string $bankaccountcheck_type
821
*/
121
*/
122
protected $klarna_config = array();
123
124
+ /**
125
+ * @var string
126
+ */
127
+ protected $klarna_campaign_code = '';
128
+
129
/**
130
* @var int
131
*/
157
* @var int
158
*/
159
protected $sepa_mandate_download_enabled = 1;
160
+ /**
161
+ * @var int
162
+ */
163
+ protected $customer_form_data_save = 0;
164
/**
165
* @var int
166
*/
477
return $this->klarna_config;
478
}
479
480
+ /**
481
+ * @param string $klarna_campaign_code
482
+ */
483
+ public function setKlarnaCampaignCode($klarna_campaign_code)
484
+ {
485
+ $this->klarna_campaign_code = $klarna_campaign_code;
486
+ }
487
+
488
+ /**
489
+ * @return string
490
+ */
491
+ public function getKlarnaCampaignCode()
492
+ {
493
+ return $this->klarna_campaign_code;
494
+ }
495
+
496
/**
497
* @param int $mid
498
*/
840
return $this->sepa_mandate_download_enabled;
841
}
842
843
+ /**
844
+ * @param int $customerFormDataSave
845
+ */
846
+ public function setCustomerFormDataSave($customerFormDataSave)
847
+ {
848
+ $this->customer_form_data_save = $customerFormDataSave;
849
+ }
850
+
851
+ /**
852
+ * @return int
853
+ */
854
+ public function getCustomerFormDataSave()
855
+ {
856
+ return $this->customer_form_data_save;
857
+ }
858
+
859
/**
860
* @param string $bankaccountcheck_type
861
*/
app/code/community/Payone/Core/Model/Config/Payment/Method/Interface.php CHANGED
@@ -170,6 +170,16 @@ interface Payone_Core_Model_Config_Payment_Method_Interface
170
*/
171
public function getSepaMandateDownloadEnabled();
172
173
/**
174
* @param int $check_cvc
175
*/
@@ -273,6 +283,16 @@ interface Payone_Core_Model_Config_Payment_Method_Interface
273
*/
274
public function getKlarnaConfig();
275
276
/**
277
* @param int $mid
278
*/
170
*/
171
public function getSepaMandateDownloadEnabled();
172
173
+ /**
174
+ * @param int $customerFormDataSave
175
+ */
176
+ public function setCustomerFormDataSave($customerFormDataSave);
177
+
178
+ /**
179
+ * @return int
180
+ */
181
+ public function getCustomerFormDataSave();
182
+
183
/**
184
* @param int $check_cvc
185
*/
283
*/
284
public function getKlarnaConfig();
285
286
+ /**
287
+ * @param string $klarna_campaign_code
288
+ */
289
+ public function setKlarnaCampaignCode($klarna_campaign_code);
290
+
291
+ /**
292
+ * @return string
293
+ */
294
+ public function getKlarnaCampaignCode();
295
+
296
/**
297
* @param int $mid
298
*/
app/code/community/Payone/Core/Model/Domain/Customer.php ADDED
@@ -0,0 +1,103 @@
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 Domain
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_Model
28
+ * @subpackage Domain
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_Domain_Customer
34
+ extends Mage_Core_Model_Abstract
35
+ {
36
+ /**
37
+ *
38
+ */
39
+ public function _construct()
40
+ {
41
+ parent::_construct();
42
+ $this->_init('payone_core/customer');
43
+ }
44
+
45
+
46
+
47
+ /**
48
+ * @param int $customerId
49
+ * @param string $paymentMethodCode
50
+ * @return Payone_Core_Model_Domain_Customer
51
+ */
52
+ public function loadByCustomerIdPaymentCode($customerId, $paymentMethodCode)
53
+ {
54
+ $collection = Mage::getModel('payone_core/domain_customer')->getCollection();
55
+ $collection->addFieldToFilter('customer_id', array('eq'=>$customerId));
56
+ $collection->addFieldToFilter('code', array('eq'=>$paymentMethodCode));
57
+ foreach($collection->load() as $item) {
58
+ return $item;
59
+ }
60
+ return $this;
61
+ }
62
+
63
+ /**
64
+ * @param int $customerId
65
+ * @return string
66
+ */
67
+ public function getLastPaymentCode($customerId)
68
+ {
69
+ $collection = Mage::getModel('payone_core/domain_customer')->getCollection();
70
+ $collection->addFieldToFilter('customer_id', array('eq'=>$customerId));
71
+ foreach($collection->load() as $item) {
72
+ return $item->getCode();
73
+ }
74
+ return '';
75
+ }
76
+
77
+ /**
78
+ * @param array $customerData
79
+ * @return Payone_Core_Model_Domain_Customer
80
+ */
81
+ public function setCustomerData($customerData)
82
+ {
83
+ $plain_customer_data = Mage::helper('core')->jsonEncode($customerData);
84
+ $this->customer_data = Mage::helper('core')->encrypt($plain_customer_data);
85
+ // $this->customer_data = $plain_customer_data;
86
+ return $this;
87
+ }
88
+
89
+ /**
90
+ * @param string $key
91
+ * @return array
92
+ */
93
+ public function getCustomerData($key = null)
94
+ {
95
+ $plain_customer_data = Mage::helper('core')->decrypt($this->customer_data);
96
+ // $plain_customer_data = $this->customer_data;
97
+ $result = Mage::helper('core')->jsonDecode($plain_customer_data);
98
+ if(!is_null($key) && is_array($result) && isset($result[$key])) {
99
+ return $result[$key];
100
+ }
101
+ return $result;
102
+ }
103
+ }
app/code/community/Payone/Core/Model/Domain/Protocol/Api.php CHANGED
@@ -128,7 +128,7 @@ class Payone_Core_Model_Domain_Protocol_Api extends Mage_Core_Model_Abstract
128
$preparedData[$valuearr[0]] = $valuearr[1];
129
}
130
}
131
- Mage::log($preparedData, null, 'test.log', true);
132
return $preparedData;
133
}
134
}
128
$preparedData[$valuearr[0]] = $valuearr[1];
129
}
130
}
131
+
132
return $preparedData;
133
}
134
}
app/code/community/Payone/Core/Model/Domain/Resource/Customer.php ADDED
@@ -0,0 +1,44 @@
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Payone_Core to newer
12
+ * versions in the future. If you wish to customize Payone_Core for your
13
+ * needs please refer to http://www.payone.de for more information.
14
+ *
15
+ * @category Payone
16
+ * @package Payone_Core_Model
17
+ * @subpackage Domain
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_Model
28
+ * @subpackage Domain
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_Domain_Resource_Customer
34
+ extends Mage_Core_Model_Mysql4_Abstract
35
+ {
36
+ /**
37
+ *
38
+ */
39
+ public function _construct()
40
+ {
41
+ $this->_init('payone_core/customer', 'id');
42
+ }
43
+
44
+ }
app/code/community/Payone/Core/Model/Domain/Resource/Customer/Collection.php ADDED
@@ -0,0 +1,45 @@
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 Domain
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_Model
28
+ * @subpackage Domain
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
+
34
+ class Payone_Core_Model_Domain_Resource_Customer_Collection
35
+ extends Mage_Core_Model_Mysql4_Collection_Abstract
36
+ {
37
+ /**
38
+ *
39
+ */
40
+ public function _construct()
41
+ {
42
+ parent::_construct();
43
+ $this->_init('payone_core/domain_customer');
44
+ }
45
+ }
app/code/community/Payone/Core/Model/Handler/Verification/AddressCheck.php CHANGED
@@ -76,11 +76,16 @@ class Payone_Core_Model_Handler_Verification_AddressCheck
76
}
77
78
$personStatus = $response->getPersonstatus();
79
- if (array_key_exists($personStatus, $mapping) and $personStatus != 'NONE') {
80
- $score = $mapping[$personStatus];
81
-
82
$address->setData('payone_addresscheck_score', $score);
83
}
84
$this->saveCustomerAddress($address);
85
}
86
elseif ($response instanceof Payone_Api_Response_AddressCheck_Invalid) {
76
}
77
78
$personStatus = $response->getPersonstatus();
79
+ if($personStatus != 'NONE') {
80
+ if (array_key_exists($personStatus, $mapping)) {
81
+ $score = $mapping[$personStatus];
82
+ $address->setData('payone_addresscheck_score', $score);
83
+ }
84
+ } else {
85
+ $score = 'G';
86
$address->setData('payone_addresscheck_score', $score);
87
}
88
+
89
$this->saveCustomerAddress($address);
90
}
91
elseif ($response instanceof Payone_Api_Response_AddressCheck_Invalid) {
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Management/GetFile.php CHANGED
@@ -57,7 +57,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Management_GetFile
57
$request->setEncoding('UTF-8');
58
$request->setIntegratorName('Magento');
59
$request->setIntegratorVersion($helper->getMagentoVersion());
60
- $request->setSolutionName('noovias');
61
$request->setSolutionVersion($helper->getPayoneVersion());
62
63
// special parameters
57
$request->setEncoding('UTF-8');
58
$request->setIntegratorName('Magento');
59
$request->setIntegratorVersion($helper->getMagentoVersion());
60
+ $request->setSolutionName('votum');
61
$request->setSolutionVersion($helper->getPayoneVersion());
62
63
// special parameters
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Management/GetInvoice.php CHANGED
@@ -60,7 +60,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Management_GetInvoice
60
61
$request->setIntegratorName('Magento');
62
$request->setIntegratorVersion($helper->getMagentoVersion());
63
- $request->setSolutionName('noovias');
64
$request->setSolutionVersion($helper->getPayoneVersion());
65
66
$invoiceTitle = 'RG-' . $txId . '-' . $sequenceNumber;
60
61
$request->setIntegratorName('Magento');
62
$request->setIntegratorVersion($helper->getMagentoVersion());
63
+ $request->setSolutionName('votum');
64
$request->setSolutionVersion($helper->getPayoneVersion());
65
66
$invoiceTitle = 'RG-' . $txId . '-' . $sequenceNumber;
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Management/ManageMandate.php CHANGED
@@ -62,7 +62,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Management_ManageMandate
62
$request->setEncoding('UTF-8');
63
$request->setIntegratorName('Magento');
64
$request->setIntegratorVersion($helper->getMagentoVersion());
65
- $request->setSolutionName('noovias');
66
$request->setSolutionVersion($helper->getPayoneVersion());
67
68
// special parameters
62
$request->setEncoding('UTF-8');
63
$request->setIntegratorName('Magento');
64
$request->setIntegratorVersion($helper->getMagentoVersion());
65
+ $request->setSolutionName('votum');
66
$request->setSolutionVersion($helper->getPayoneVersion());
67
68
// special parameters
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Abstract.php CHANGED
@@ -79,7 +79,7 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Abstract
79
{
80
$helper = $this->helper();
81
82
- $solutionName = 'noovias';
83
$solutionVersion = $helper->getPayoneVersion();
84
$integratorName = 'magento';
85
$integratorVersion = $helper->getMagentoVersion();
@@ -107,6 +107,7 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Abstract
107
if (empty($sku)) {
108
$sku = $this->helper()->__(self::DEFAULT_SHIPPING_SKU);
109
}
110
$params['id'] = $sku;
111
$params['de'] = $order->getShippingDescription();
112
$params['no'] = 1;
@@ -138,7 +139,7 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Abstract
138
if (empty($description)) {
139
$description = $this->helper()->__(self::DEFAULT_DISCOUNT_SKU);
140
}
141
-
142
$params['id'] = $sku;
143
$params['de'] = $description;
144
$params['no'] = 1;
@@ -168,7 +169,7 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Abstract
168
if (empty($sku)) {
169
$sku = $this->helper()->__(self::DEFAULT_SHIPPING_SKU);
170
}
171
-
172
$params['id'] = $sku;
173
$params['de'] = $order->getShippingDescription();
174
$params['no'] = 1;
@@ -201,6 +202,7 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Abstract
201
$name = $this->helper()->__(self::DEFAULT_ADJUSTMENT_POSITIVE_SKU);
202
}
203
204
$params['id'] = $sku;
205
$params['de'] = $name;
206
$params['no'] = 1;
@@ -234,6 +236,7 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Abstract
234
$name = $this->helper()->__(self::DEFAULT_ADJUSTMENT_NEGATIVE_SKU);
235
}
236
237
$params['id'] = $sku;
238
$params['de'] = $name;
239
$params['no'] = 1;
79
{
80
$helper = $this->helper();
81
82
+ $solutionName = 'votum';
83
$solutionVersion = $helper->getPayoneVersion();
84
$integratorName = 'magento';
85
$integratorVersion = $helper->getMagentoVersion();
107
if (empty($sku)) {
108
$sku = $this->helper()->__(self::DEFAULT_SHIPPING_SKU);
109
}
110
+ $params['it'] = Payone_Api_Enum_InvoicingItemType::SHIPMENT;
111
$params['id'] = $sku;
112
$params['de'] = $order->getShippingDescription();
113
$params['no'] = 1;
139
if (empty($description)) {
140
$description = $this->helper()->__(self::DEFAULT_DISCOUNT_SKU);
141
}
142
+ $params['it'] = Payone_Api_Enum_InvoicingItemType::VOUCHER;
143
$params['id'] = $sku;
144
$params['de'] = $description;
145
$params['no'] = 1;
169
if (empty($sku)) {
170
$sku = $this->helper()->__(self::DEFAULT_SHIPPING_SKU);
171
}
172
+ $params['it'] = Payone_Api_Enum_InvoicingItemType::SHIPMENT;
173
$params['id'] = $sku;
174
$params['de'] = $order->getShippingDescription();
175
$params['no'] = 1;
202
$name = $this->helper()->__(self::DEFAULT_ADJUSTMENT_POSITIVE_SKU);
203
}
204
205
+ $params['it'] = Payone_Api_Enum_InvoicingItemType::GOODS;
206
$params['id'] = $sku;
207
$params['de'] = $name;
208
$params['no'] = 1;
236
$name = $this->helper()->__(self::DEFAULT_ADJUSTMENT_NEGATIVE_SKU);
237
}
238
239
+ $params['it'] = Payone_Api_Enum_InvoicingItemType::GOODS;
240
$params['id'] = $sku;
241
$params['de'] = $name;
242
$params['no'] = 1;
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Authorize/Abstract.php CHANGED
@@ -209,6 +209,13 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
209
$personalData = $this->mapPersonalParametersSafeInvoiceKlarna($personalData);
210
}
211
212
return $personalData;
213
}
214
@@ -377,6 +384,7 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
377
continue; // Do not map items with zero quanity
378
}
379
380
$params['id'] = $itemData->getSku();
381
$params['pr'] = $itemData->getPriceInclTax();
382
$params['no'] = $number;
@@ -479,6 +487,18 @@ abstract class Payone_Core_Model_Mapper_ApiRequest_Payment_Authorize_Abstract
479
$payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_Financing();
480
$payment->setFinancingtype($info->getPayoneFinancingType());
481
482
$isRedirect = true;
483
}
484
209
$personalData = $this->mapPersonalParametersSafeInvoiceKlarna($personalData);
210
}
211
212
+ // Financing "Klarna" specific personal parameters mapping
213
+ if ($paymentMethod instanceof Payone_Core_Model_Payment_Method_Financing
214
+ and $paymentMethod->getInfoInstance()->getPayoneFinancingType() == Payone_Api_Enum_FinancingType::KLS
215
+ ) {
216
+ $personalData = $this->mapPersonalParametersSafeInvoiceKlarna($personalData);
217
+ }
218
+
219
return $personalData;
220
}
221
384
continue; // Do not map items with zero quanity
385
}
386
387
+ $params['it'] = Payone_Api_Enum_InvoicingItemType::GOODS;
388
$params['id'] = $itemData->getSku();
389
$params['pr'] = $itemData->getPriceInclTax();
390
$params['no'] = $number;
487
$payment = new Payone_Api_Request_Parameter_Authorization_PaymentMethod_Financing();
488
$payment->setFinancingtype($info->getPayoneFinancingType());
489
490
+ if($info->getPayoneFinancingType() == Payone_Api_Enum_FinancingType::KLS) {
491
+ $configPaymentMethodId = $info->getPayoneConfigPaymentMethodId();
492
+ $paymentConfig = $paymentMethod->getConfigPayment();
493
+
494
+
495
+ $payData = new Payone_Api_Request_Parameter_Paydata_Paydata();
496
+ $payData->addItem(new Payone_Api_Request_Parameter_Paydata_DataItem(
497
+ array('key' => 'klsid', 'data' => $info->getPayoneKlarnaCampaignCode())
498
+ ));
499
+ $payment->setPaydata($payData);
500
+ }
501
+
502
$isRedirect = true;
503
}
504
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Capture.php CHANGED
@@ -91,9 +91,9 @@ class Payone_Core_Model_Mapper_ApiRequest_Payment_Capture
91
$request->setTxid($order->getPayment()->getLastTransId());
92
$request->setSequencenumber($transaction->getNextSequenceNumber());
93
$request->setCurrency($order->getOrderCurrencyCode());
94
- $request->setAmount($this->getAmount());
95
$request->setRequest(Payone_Api_Enum_RequestType::CAPTURE);
96
- Mage::log('Capture', null, 'test.log', true);
97
}
98
99
/**
@@ -172,6 +172,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Payment_Capture
172
if ($number <= 0) {
173
continue; // Do not map items with zero quantity
174
}
175
$params['id'] = $itemData->getSku();
176
$params['de'] = $itemData->getName();
177
$params['no'] = $number;
91
$request->setTxid($order->getPayment()->getLastTransId());
92
$request->setSequencenumber($transaction->getNextSequenceNumber());
93
$request->setCurrency($order->getOrderCurrencyCode());
94
+ // $request->setAmount($this->getAmount());
95
+ $request->setAmount($order->getGrandTotal());
96
$request->setRequest(Payone_Api_Enum_RequestType::CAPTURE);
97
}
98
99
/**
172
if ($number <= 0) {
173
continue; // Do not map items with zero quantity
174
}
175
+ $params['it'] = Payone_Api_Enum_InvoicingItemType::GOODS;
176
$params['id'] = $itemData->getSku();
177
$params['de'] = $itemData->getName();
178
$params['no'] = $number;
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Payment/Debit.php CHANGED
@@ -90,11 +90,6 @@ class Payone_Core_Model_Mapper_ApiRequest_Payment_Debit
90
$request->setAmount($this->getAmount() * -1);
91
$request->setRequest(Payone_Api_Enum_RequestType::DEBIT);
92
$request->setUseCustomerdata('yes');
93
-
94
- Mage::log('aaa', null, 'test.log', true);
95
- if($this->configPayment->getCurrencyConvert()) {
96
- $request->setCurrency($order->getBaseCurrencyCode());
97
- }
98
}
99
100
/**
90
$request->setAmount($this->getAmount() * -1);
91
$request->setRequest(Payone_Api_Enum_RequestType::DEBIT);
92
$request->setUseCustomerdata('yes');
93
}
94
95
/**
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/AddressCheck.php CHANGED
@@ -81,7 +81,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Verification_AddressCheck
81
82
$request->setIntegratorName('Magento');
83
$request->setIntegratorVersion($helper->getMagentoVersion());
84
- $request->setSolutionName('noovias');
85
$request->setSolutionVersion($helper->getPayoneVersion());
86
87
81
82
$request->setIntegratorName('Magento');
83
$request->setIntegratorVersion($helper->getMagentoVersion());
84
+ $request->setSolutionName('votum');
85
$request->setSolutionVersion($helper->getPayoneVersion());
86
87
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/BankAccountCheck.php CHANGED
@@ -61,7 +61,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Verification_BankAccountCheck
61
62
$request->setIntegratorName('Magento');
63
$request->setIntegratorVersion($helper->getMagentoVersion());
64
- $request->setSolutionName('noovias');
65
$request->setSolutionVersion($helper->getPayoneVersion());
66
67
61
62
$request->setIntegratorName('Magento');
63
$request->setIntegratorVersion($helper->getMagentoVersion());
64
+ $request->setSolutionName('votum');
65
$request->setSolutionVersion($helper->getPayoneVersion());
66
67
app/code/community/Payone/Core/Model/Mapper/ApiRequest/Verification/Creditrating.php CHANGED
@@ -70,7 +70,7 @@ class Payone_Core_Model_Mapper_ApiRequest_Verification_Creditrating
70
71
$request->setIntegratorName('Magento');
72
$request->setIntegratorVersion($helper->getMagentoVersion());
73
- $request->setSolutionName('noovias');
74
$request->setSolutionVersion($helper->getPayoneVersion());
75
if($customerId = $address->getCustomerId())
76
{
70
71
$request->setIntegratorName('Magento');
72
$request->setIntegratorVersion($helper->getMagentoVersion());
73
+ $request->setSolutionName('votum');
74
$request->setSolutionVersion($helper->getPayoneVersion());
75
if($customerId = $address->getCustomerId())
76
{
app/code/community/Payone/Core/Model/Observer/Checkout/Onepage/DebitPayment.php CHANGED
@@ -82,7 +82,12 @@ class Payone_Core_Model_Observer_Checkout_Onepage_DebitPayment extends Payone_Co
82
}
83
84
if ($sepaMandateEnabled) {
85
- $this->manageMandate();
86
}
87
}
88
@@ -137,16 +142,22 @@ class Payone_Core_Model_Observer_Checkout_Onepage_DebitPayment extends Payone_Co
137
$bankCountry = array_key_exists('payone_bank_country', $paymentData) ? $paymentData['payone_bank_country'] : '';
138
139
$response = $manageMandateService->execute($this->getQuote(), $bankCountry, $bankAccountNumber, $bankCode, $bic, $iban);
140
- $mandateStatus = $response->getMandateStatus();
141
- $mandateText = $response->getMandateText();
142
- $mandateIdentification = $response->getMandateIdentification();
143
- $sepaMandateDownloadEnabled = $paymentConfig->getSepaMandateDownloadEnabled();
144
-
145
- $checkoutSession = $this->getFactory()->getSingletonCheckoutSession();
146
- $checkoutSession->setPayoneSepaMandateStatus($mandateStatus);
147
- $checkoutSession->setPayoneSepaMandateText($mandateText);
148
- $checkoutSession->setPayoneSepaMandateIdentification($mandateIdentification);
149
- $checkoutSession->setPayoneSepaMandateDownloadEnabled($sepaMandateDownloadEnabled);
150
}
151
152
/**
82
}
83
84
if ($sepaMandateEnabled) {
85
+ $response = $this->manageMandate();
86
+ if($response instanceof Payone_Api_Response_Error) {
87
+ $controllerAction->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
88
+ $jsonResponse = array('error' => Mage::helper('payone_core')->__($response->getErrormessage()));
89
+ return $controllerAction->getResponse()->setBody(Mage::helper('core')->jsonEncode($jsonResponse));
90
+ }
91
}
92
}
93
142
$bankCountry = array_key_exists('payone_bank_country', $paymentData) ? $paymentData['payone_bank_country'] : '';
143
144
$response = $manageMandateService->execute($this->getQuote(), $bankCountry, $bankAccountNumber, $bankCode, $bic, $iban);
145
+ if($response instanceof Payone_Api_Response_Management_ManageMandate_Approved) {
146
+ $mandateStatus = $response->getMandateStatus();
147
+ $mandateText = $response->getMandateText();
148
+ $mandateIdentification = $response->getMandateIdentification();
149
+ $sepaMandateDownloadEnabled = $paymentConfig->getSepaMandateDownloadEnabled();
150
+
151
+ $checkoutSession = $this->getFactory()->getSingletonCheckoutSession();
152
+ $checkoutSession->setPayoneSepaMandateStatus($mandateStatus);
153
+ $checkoutSession->setPayoneSepaMandateText($mandateText);
154
+ $checkoutSession->setPayoneSepaMandateIdentification($mandateIdentification);
155
+ $checkoutSession->setPayoneSepaMandateDownloadEnabled($sepaMandateDownloadEnabled);
156
+ }
157
+ return $response;
158
+ // else {
159
+ // Mage::log($response, null, 'test.log', true);
160
+ // }
161
}
162
163
/**
app/code/community/Payone/Core/Model/Observer/Checkout/Onepage/Payment/Methods.php CHANGED
@@ -50,6 +50,14 @@ class Payone_Core_Model_Observer_Checkout_Onepage_Payment_Methods
50
*/
51
$quote = $observer->getEvent()->getQuote();
52
53
/** @var $fullActionName string */
54
$fullActionName = $observer->getEvent()->getFullActionName();
55
if ($fullActionName === 'checkout/onepage/index') {
50
*/
51
$quote = $observer->getEvent()->getQuote();
52
53
+ if(!$quote->getCustomerIsGuest()) {
54
+ try {
55
+ $quote->getPayment()->setMethod($quote->getCustomer()->getPayoneLastPaymentMethod())->getMethodInstance();
56
+ } catch ( Exception $e ) {
57
+ Mage::logException($e);
58
+ }
59
+ }
60
+
61
/** @var $fullActionName string */
62
$fullActionName = $observer->getEvent()->getFullActionName();
63
if ($fullActionName === 'checkout/onepage/index') {
app/code/community/Payone/Core/Model/Observer/Sales/Order.php CHANGED
@@ -33,6 +33,7 @@
33
class Payone_Core_Model_Observer_Sales_Order
34
extends Payone_Core_Model_Observer_Abstract
35
{
36
/**
37
* @param Varien_Event_Observer $observer
38
* @return void
@@ -78,4 +79,65 @@ class Payone_Core_Model_Observer_Sales_Order
78
$methodInstance->cancel($payment);
79
}
80
}
81
}
33
class Payone_Core_Model_Observer_Sales_Order
34
extends Payone_Core_Model_Observer_Abstract
35
{
36
+
37
/**
38
* @param Varien_Event_Observer $observer
39
* @return void
79
$methodInstance->cancel($payment);
80
}
81
}
82
+
83
+ /**
84
+ *
85
+ * @param Varien_Event_Observer $observer (has data 'payment' with a payment info instance (Mage_Sales_Model_Order_Payment))
86
+ */
87
+ public function paymentPlaceEnd(Varien_Event_Observer $observer)
88
+ {
89
+ /** @var $payment Mage_Sales_Model_Order_Payment */
90
+ $payment = $observer->getEvent()->getPayment();
91
+
92
+ if(!$payment->getOrder()->getCustomerIsGuest()) {
93
+ $customer = $payment->getOrder()->getCustomer();
94
+ $customer->setPayoneLastPaymentMethod($payment->getMethod());
95
+ $customer->save();
96
+ }
97
+
98
+
99
+ if(($payment->getMethodInstance() instanceof Payone_Core_Model_Payment_Method_Abstract) && (!$payment->getOrder()->getCustomerIsGuest())) {
100
+ $customerId = $payment->getOrder()->getCustomer()->getId();
101
+ $customerSavedData = array();
102
+ $paymentMethodCode = '';
103
+ if($payment->getMethodInstance()->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::DEBITPAYMENT) {
104
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
105
+ $customerSavedData['payone_account_number'] = $payment->getPayoneAccountNumber()?$payment->getPayoneAccountNumber():'';
106
+ $customerSavedData['payone_bank_code'] = $payment->getPayoneBankCode()?$payment->getPayoneBankCode():'';
107
+ $customerSavedData['payone_sepa_iban'] = $payment->getPayoneSepaIban()?$payment->getPayoneSepaIban():'';
108
+ $customerSavedData['payone_sepa_bic'] = $payment->getPayoneSepaBic()?$payment->getPayoneSepaBic():'';
109
+ $customerSavedData['payone_bank_country'] = $payment->getPayoneBankCountry();
110
+ }
111
+ if($payment->getMethodInstance()->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::ONLINEBANKTRANSFER) {
112
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
113
+ $customerSavedData['payone_onlinebanktransfer_type'] = $payment->getPayoneOnlinebanktransferType();
114
+ $customerSavedData['payone_account_number'] = $payment->getPayoneAccountNumber()?$payment->getPayoneAccountNumber():'';
115
+ $customerSavedData['payone_bank_code'] = $payment->getPayoneBankCode()?$payment->getPayoneBankCode():'';
116
+ $customerSavedData['payone_sepa_iban'] = $payment->getPayoneSepaIban()?$payment->getPayoneSepaIban():'';
117
+ $customerSavedData['payone_sepa_bic'] = $payment->getPayoneSepaBic()?$payment->getPayoneSepaBic():'';
118
+ $customerSavedData['payone_bank_group'] = $payment->getPayoneBankGroup();
119
+ }
120
+ if($payment->getMethodInstance()->getCode() == Payone_Core_Model_System_Config_PaymentMethodCode::CREDITCARD) {
121
+ $paymentMethodCode = $payment->getMethodInstance()->getCode();
122
+ $customerSavedData['cc_owner'] = $payment->getCcOwner();
123
+ $customerSavedData['cc_type'] = $payment->getCcType();
124
+ $customerSavedData['cc_exp_year'] = $payment->getCcExpYear();
125
+ $customerSavedData['cc_exp_month'] = $payment->getCcExpMonth();
126
+ $customerSavedData['cc_number_enc'] = $payment->getCcNumberEnc();
127
+ $customerSavedData['payone_pseudocardpan'] = $payment->getPayonePseudocardpan();
128
+ $customerSavedData['payone_config_payment_method_id'] = $payment->getPayoneConfigPaymentMethodId();
129
+ }
130
+
131
+ if(!empty($paymentMethodCode)) {
132
+ $paymentCustomerModel = Mage::getModel('payone_core/domain_customer')->loadByCustomerIdPaymentCode($customerId, $paymentMethodCode);
133
+ $paymentCustomerModel->setCustomerId($customerId);
134
+ $paymentCustomerModel->setCode($paymentMethodCode);
135
+ $paymentCustomerModel->setCustomerData($customerSavedData);
136
+ $paymentCustomerModel->save();
137
+ // Mage::log($paymentMethodCode, null, 'test.log', true);
138
+ }
139
+ }
140
+
141
+
142
+ }
143
}
app/code/community/Payone/Core/Model/Service/Management/ManageMandate.php CHANGED
@@ -58,10 +58,9 @@ class Payone_Core_Model_Service_Management_ManageMandate
58
59
$response = $this->getServiceApiManageMandate()->managemandate($request);
60
61
- if (!$response instanceof Payone_Api_Response_Management_ManageMandate_Approved) {
62
- throw new Mage_Core_Exception($this->helper()->__('There has been an error processing your request.'));
63
- }
64
-
65
return $response;
66
}
67
58
59
$response = $this->getServiceApiManageMandate()->managemandate($request);
60
61
+ // if (!$response instanceof Payone_Api_Response_Management_ManageMandate_Approved) {
62
+ // throw new Mage_Payment_Exception($this->helper()->__('There has been an error processing your request.'));
63
+ // }
64
return $response;
65
}
66
app/code/community/Payone/Core/Model/System/Config/FinancingType.php CHANGED
@@ -16,9 +16,9 @@
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
/**
@@ -26,9 +26,9 @@
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_FinancingType extends Payone_Core_Model_System_Config_Abstract
34
{
@@ -37,13 +37,20 @@ class Payone_Core_Model_System_Config_FinancingType extends Payone_Core_Model_Sy
37
*/
38
public function toArray()
39
{
40
- $settings = new Payone_Settings_Configuration_PaymentMethod_Financing();
41
42
- $types = $settings->getTypes();
43
- if(array_key_exists(Payone_Api_Enum_FinancingType::BSV, $types))
44
- unset($types[Payone_Api_Enum_FinancingType::BSV]); // BSV has a separate Payment method.
45
- if(array_key_exists(Payone_Api_Enum_FinancingType::KLV, $types))
46
- unset($types[Payone_Api_Enum_FinancingType::KLV]); // KLV has a separate Payment method.
47
return $types;
48
}
49
}
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
/**
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
{
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/etc/config.xml CHANGED
@@ -15,16 +15,16 @@
15
* @category Payone
16
* @package Payone_Core
17
* @subpackage etc
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
<config>
25
<modules>
26
<Payone_Core>
27
- <version>3.2.0</version>
28
</Payone_Core>
29
</modules>
30
@@ -67,6 +67,9 @@
67
<config_payment_method>
68
<table>payone_config_payment_method</table>
69
</config_payment_method>
70
</entities>
71
</payone_core_resource>
72
@@ -157,6 +160,10 @@
157
<!-- Financing: Type -->
158
<to_order_payment>*</to_order_payment>
159
</payone_safe_invoice_type>
160
<payone_onlinebanktransfer_type>
161
<!-- Online Bank Transfer: Type -->
162
<to_order_payment>*</to_order_payment>
@@ -328,6 +335,14 @@
328
</payone_core_observer>
329
</observers>
330
</sales_order_resource_init_virtual_grid_columns>
331
<sales_order_place_after>
332
<observers>
333
<payone_core_observer>
@@ -430,6 +445,15 @@
430
</payone_core_observer_config_protect>
431
</observers>
432
</admin_system_config_changed_section_payone_protect>
433
</events>
434
</global>
435
15
* @category Payone
16
* @package Payone_Core
17
* @subpackage etc
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
<config>
25
<modules>
26
<Payone_Core>
27
+ <version>3.3.0</version>
28
</Payone_Core>
29
</modules>
30
67
<config_payment_method>
68
<table>payone_config_payment_method</table>
69
</config_payment_method>
70
+ <customer>
71
+ <table>payone_customer</table>
72
+ </customer>
73
</entities>
74
</payone_core_resource>
75
160
<!-- Financing: Type -->
161
<to_order_payment>*</to_order_payment>
162
</payone_safe_invoice_type>
163
+ <payone_klarna_campaign_code>
164
+ <!-- Financing Klarna: Campaign Code -->
165
+ <to_order_payment>*</to_order_payment>
166
+ </payone_klarna_campaign_code>
167
<payone_onlinebanktransfer_type>
168
<!-- Online Bank Transfer: Type -->
169
<to_order_payment>*</to_order_payment>
335
</payone_core_observer>
336
</observers>
337
</sales_order_resource_init_virtual_grid_columns>
338
+ <sales_order_payment_place_end>
339
+ <observers>
340
+ <payone_core_observer>
341
+ <class>payone_core/observer_sales_order</class>
342
+ <method>paymentPlaceEnd</method>
343
+ </payone_core_observer>
344
+ </observers>
345
+ </sales_order_payment_place_end>
346
<sales_order_place_after>
347
<observers>
348
<payone_core_observer>
445
</payone_core_observer_config_protect>
446
</observers>
447
</admin_system_config_changed_section_payone_protect>
448
+
449
+ <sales_order_save_commit_after>
450
+ <observers>
451
+ <downloadable_observer>
452
+ <class>downloadable/observer</class>
453
+ <method>setLinkStatus</method>
454
+ </downloadable_observer>
455
+ </observers>
456
+ </sales_order_save_commit_after>
457
</events>
458
</global>
459
app/code/community/Payone/Core/etc/system.xml CHANGED
@@ -633,6 +633,15 @@
633
<show_in_website>1</show_in_website>
634
<show_in_store>1</show_in_store>
635
</check_cvc>
636
</fields>
637
</template_creditcard>
638
<template_debit_payment translate="label" module="payone_core">
@@ -715,6 +724,15 @@
715
<show_in_website>1</show_in_website>
716
<show_in_store>1</show_in_store>
717
</sepa_mandate_download_enabled>
718
</fields>
719
</template_debit_payment>
720
<template_online_bank_transfer translate="label" module="payone_core">
@@ -734,6 +752,15 @@
734
<show_in_website>1</show_in_website>
735
<show_in_store>1</show_in_store>
736
</types>
737
</fields>
738
</template_online_bank_transfer>
739
<template_invoice translate="label" module="payone_core">
@@ -809,16 +836,34 @@
809
<show_in_website>1</show_in_website>
810
<show_in_store>1</show_in_store>
811
</types>
812
- <request_type translate="label">
813
<label>Authorize-Method</label>
814
<comment>Please note that for Commerz Finanz only the mode "preauthorization" is available. Afterwards payments must be captured. (CAPTURE)</comment>
815
<frontend_type>select</frontend_type>
816
<source_model>payone_core/system_config_authorizeMethodFinancing</source_model>
817
- <sort_order>210</sort_order>
818
<show_in_default>1</show_in_default>
819
<show_in_website>1</show_in_website>
820
<show_in_store>1</show_in_store>
821
- </request_type>
822
</fields>
823
</template_financing>
824
<template_wallet translate="label" module="payone_core">
@@ -882,7 +927,7 @@
882
<show_in_store>1</show_in_store>
883
</hint>
884
<address_check>
885
- <label>Addresscheck</label>
886
<frontend_type>text</frontend_type>
887
<sort_order>10</sort_order>
888
<show_in_default>1</show_in_default>
@@ -890,7 +935,7 @@
890
<show_in_store>1</show_in_store>
891
<fields>
892
<hint translate="label">
893
- <label>Addresscheck</label>
894
<sort_order>0</sort_order>
895
<show_in_default>1</show_in_default>
896
<show_in_website>1</show_in_website>
@@ -1027,7 +1072,7 @@
1027
</fields>
1028
</address_check>
1029
<creditrating>
1030
- <label>Creditrating</label>
1031
<frontend_type>text</frontend_type>
1032
<sort_order>20</sort_order>
1033
<show_in_default>1</show_in_default>
@@ -1035,7 +1080,7 @@
1035
<show_in_store>1</show_in_store>
1036
<fields>
1037
<hint translate="label">
1038
- <label>Creditrating</label>
1039
<sort_order>0</sort_order>
1040
<show_in_default>1</show_in_default>
1041
<show_in_website>1</show_in_website>
633
<show_in_website>1</show_in_website>
634
<show_in_store>1</show_in_store>
635
</check_cvc>
636
+ <customer_form_data_save translate="label,comment">
637
+ <label>Save payment data for logged in customer</label>
638
+ <frontend_type>select</frontend_type>
639
+ <source_model>adminhtml/system_config_source_yesno</source_model>
640
+ <sort_order>270</sort_order>
641
+ <show_in_default>1</show_in_default>
642
+ <show_in_website>1</show_in_website>
643
+ <show_in_store>1</show_in_store>
644
+ </customer_form_data_save>
645
</fields>
646
</template_creditcard>
647
<template_debit_payment translate="label" module="payone_core">
724
<show_in_website>1</show_in_website>
725
<show_in_store>1</show_in_store>
726
</sepa_mandate_download_enabled>
727
+ <customer_form_data_save translate="label,comment">
728
+ <label>Save payment data for logged in customer</label>
729
+ <frontend_type>select</frontend_type>
730
+ <source_model>adminhtml/system_config_source_yesno</source_model>
731
+ <sort_order>270</sort_order>
732
+ <show_in_default>1</show_in_default>
733
+ <show_in_website>1</show_in_website>
734
+ <show_in_store>1</show_in_store>
735
+ </customer_form_data_save>
736
</fields>
737
</template_debit_payment>
738
<template_online_bank_transfer translate="label" module="payone_core">
752
<show_in_website>1</show_in_website>
753
<show_in_store>1</show_in_store>
754
</types>
755
+ <customer_form_data_save translate="label,comment">
756
+ <label>Save payment data for logged in customer</label>
757
+ <frontend_type>select</frontend_type>
758
+ <source_model>adminhtml/system_config_source_yesno</source_model>
759
+ <sort_order>270</sort_order>
760
+ <show_in_default>1</show_in_default>
761
+ <show_in_website>1</show_in_website>
762
+ <show_in_store>1</show_in_store>
763
+ </customer_form_data_save>
764
</fields>
765
</template_online_bank_transfer>
766
<template_invoice translate="label" module="payone_core">
836
<show_in_website>1</show_in_website>
837
<show_in_store>1</show_in_store>
838
</types>
839
+ <klarna_config translate="label">
840
+ <label>Klarna Store-IDs</label>
841
+ <comment>Required when using Klarna</comment>
842
+ <frontend_model>payone_core/adminhtml_system_config_form_field_klarnaStoreId</frontend_model>
843
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
844
+ <sort_order>210</sort_order>
845
+ <show_in_default>1</show_in_default>
846
+ <show_in_website>1</show_in_website>
847
+ <show_in_store>1</show_in_store>
848
+ </klarna_config>
849
+ <klarna_campaign_code translate="label, comment">
850
+ <label>Klarna Campaign Code</label>
851
+ <frontend_type>text</frontend_type>
852
+ <sort_order>220</sort_order>
853
+ <show_in_default>1</show_in_default>
854
+ <show_in_website>1</show_in_website>
855
+ <show_in_store>1</show_in_store>
856
+ </klarna_campaign_code>
857
+ <request_type_cfr translate="label">
858
<label>Authorize-Method</label>
859
<comment>Please note that for Commerz Finanz only the mode "preauthorization" is available. Afterwards payments must be captured. (CAPTURE)</comment>
860
<frontend_type>select</frontend_type>
861
<source_model>payone_core/system_config_authorizeMethodFinancing</source_model>
862
+ <sort_order>230</sort_order>
863
<show_in_default>1</show_in_default>
864
<show_in_website>1</show_in_website>
865
<show_in_store>1</show_in_store>
866
+ </request_type_cfr>
867
</fields>
868
</template_financing>
869
<template_wallet translate="label" module="payone_core">
927
<show_in_store>1</show_in_store>
928
</hint>
929
<address_check>
930
+ <label>Address checking</label>
931
<frontend_type>text</frontend_type>
932
<sort_order>10</sort_order>
933
<show_in_default>1</show_in_default>
935
<show_in_store>1</show_in_store>
936
<fields>
937
<hint translate="label">
938
+ <label>Address checking</label>
939
<sort_order>0</sort_order>
940
<show_in_default>1</show_in_default>
941
<show_in_website>1</show_in_website>
1072
</fields>
1073
</address_check>
1074
<creditrating>
1075
+ <label>Credit rating</label>
1076
<frontend_type>text</frontend_type>
1077
<sort_order>20</sort_order>
1078
<show_in_default>1</show_in_default>
1080
<show_in_store>1</show_in_store>
1081
<fields>
1082
<hint translate="label">
1083
+ <label>Credit rating</label>
1084
<sort_order>0</sort_order>
1085
<show_in_default>1</show_in_default>
1086
<show_in_website>1</show_in_website>
app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.2.1-3.2.2.php ADDED
@@ -0,0 +1,102 @@
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
17
+ * @subpackage sql
18
+ * @copyright Copyright (c) 2013 <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
+ /** @var $this Mage_Core_Model_Resource_Setup */
25
+ /** @var $installer Mage_Core_Model_Resource_Setup */
26
+
27
+ $installer = $this;
28
+ $installer->startSetup();
29
+ $tableCustomer = $this->getTable('payone_core/customer');
30
+ $tablePaymentMethod = $this->getTable('payone_core/config_payment_method');
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.2.1-3.2.2.sql');
38
+
39
+ $installSqlConfig = array(
40
+ '{{payone_customer}}' => $tableCustomer,
41
+ '{{payone_config_payment_method}}' => $tablePaymentMethod,
42
+ );
43
+
44
+ $installSql = str_replace(array_keys($installSqlConfig), array_values($installSqlConfig), $sql);
45
+ $installer->run($installSql);
46
+ } else {
47
+ /** Build table 'payone_customer' */
48
+ $connection = $installer->getConnection();
49
+ $table = $connection->newTable($tableCustomer);
50
+
51
+ // Add Columns
52
+ $table->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, NULL,
53
+ array(
54
+ 'unsigned' => true,
55
+ 'nullable' => false,
56
+ 'primary' => true,
57
+ 'identity' => true,
58
+ 'auto_increment' => true)
59
+ );
60
+ $table->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, NULL,
61
+ array(
62
+ 'nullable' => true,
63
+ 'default' => NULL)
64
+ );
65
+ $table->addColumn('code', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50,
66
+ array(
67
+ 'nullable' => true,
68
+ 'default' => NULL)
69
+ );
70
+ $table->addColumn('customer_data', Varien_Db_Ddl_Table::TYPE_TEXT, NULL,
71
+ array(
72
+ 'nullable' => true,
73
+ 'default' => NULL)
74
+ );
75
+ $table->addIndex(
76
+ $installer->getIdxName(
77
+ 'payone_core/customer',
78
+ array(
79
+ 'customer_id',
80
+ 'code',
81
+ ),
82
+ Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
83
+ ),
84
+ array(
85
+ 'customer_id',
86
+ 'code',
87
+ ),
88
+ array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)
89
+ );
90
+
91
+ //Set Engine to MyISAM
92
+ $table->setOption('type', 'MyISAM');
93
+
94
+ // Create table 'payone_protocol_api'
95
+ $connection->createTable($table);
96
+
97
+ // Update table payone_config_payment_method
98
+ $connection->addColumn($tablePaymentMethod, 'customer_form_data_save',
99
+ 'INT(1) COMMENT \'Save payment data for logged in customer\' AFTER `sepa_mandate_download_enabled`'
100
+ );
101
+ }
102
+ $installer->endSetup();
app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.2.2-3.2.3.php ADDED
@@ -0,0 +1,54 @@
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
17
+ * @subpackage sql
18
+ * @copyright Copyright (c) 2013 <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
+ /** @var $this Mage_Core_Model_Resource_Setup */
25
+ /** @var $installer Mage_Core_Model_Resource_Setup */
26
+
27
+ $installer = $this;
28
+ $installer->startSetup();
29
+ $tableCustomer = $this->getTable('payone_core/customer');
30
+ $tablePaymentMethod = $this->getTable('payone_core/config_payment_method');
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.2.2-3.2.3.sql');
38
+
39
+ $installSqlConfig = array(
40
+ '{{payone_config_payment_method}}' => $tablePaymentMethod,
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
+ // Update table payone_config_payment_method
49
+ $connection->addColumn($tablePaymentMethod, 'klarna_campaign_code',
50
+ 'VARCHAR(50) COMMENT \'Klarna Campaign Code\' AFTER `klarna_config`'
51
+ );
52
+ }
53
+
54
+ $installer->endSetup();
app/code/community/Payone/Core/sql/payone_core_setup/mysql4-upgrade-3.2.3-3.3.0.php ADDED
@@ -0,0 +1,39 @@
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
17
+ * @subpackage sql
18
+ * @copyright Copyright (c) 2013 <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
+ /** @var $this Mage_Core_Model_Resource_Setup */
25
+ /** @var $installer Mage_Core_Model_Resource_Setup */
26
+
27
+ $installer = $this;
28
+ $installer->startSetup();
29
+
30
+ // Add attributes:
31
+ /* @var $installer Mage_Customer_Model_Entity_Setup */
32
+ $setup = new Mage_Customer_Model_Entity_Setup('core_setup');
33
+ $setup->addAttribute('customer', 'payone_last_payment_method', array(
34
+ 'type' => Varien_Db_Ddl_Table::TYPE_VARCHAR,
35
+ 'label' => 'Payone Last Payment Method',
36
+ 'visible' => false,
37
+ 'required' => false));
38
+
39
+ $installer->endSetup();
app/code/community/Payone/Core/sql/payone_core_setup/upgrade-3.2.1-3.2.2.sql ADDED
@@ -0,0 +1,18 @@
1
+ #-----------------------------------------------------------------
2
+ #-- Create Table payone_customer
3
+ #-----------------------------------------------------------------
4
+ DROP TABLE IF EXISTS `{{payone_customer}}` ;
5
+ CREATE TABLE `{{payone_customer}}` (
6
+ `id` INT NOT NULL AUTO_INCREMENT,
7
+ `customer_id` INT NULL,
8
+ `code` VARCHAR(50) NULL,
9
+ `customer_data` TEXT NULL,
10
+ PRIMARY KEY (`id`),
11
+ UNIQUE INDEX `UNQ_PAYONE_CUSTOMER_CUSTOMER_ID_CODE` (`customer_id` ASC, `code` ASC)
12
+ ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;
13
+
14
+ #-----------------------------------------------------------------
15
+ #-- Alter Table payone_config_payment_method, add sepa specific fields
16
+ #-----------------------------------------------------------------
17
+ ALTER TABLE `{{payone_config_payment_method}}`
18
+ ADD `customer_form_data_save` INT(1) COMMENT 'Save payment data for logged in customer' AFTER `sepa_mandate_download_enabled`;
app/code/community/Payone/Core/sql/payone_core_setup/upgrade-3.2.2-3.2.3.sql ADDED
@@ -0,0 +1,6 @@
1
+ #-----------------------------------------------------------------
2
+ #-- Alter Table payone_config_payment_method, add klarna_config
3
+ #-----------------------------------------------------------------
4
+
5
+ ALTER TABLE `{{payone_config_payment_method}}`
6
+ ADD `klarna_campaign_code` VARCHAR(50) COMMENT 'Klarna Campaign Code' AFTER `klarna_config`;
app/code/community/Payone/Licensemanager/Block/Adminhtml/Notification/Toolbar.php ADDED
@@ -0,0 +1,34 @@
1
+ <?php
2
+ /**
3
+ * Class description
4
+ *
5
+ * @category Votum
6
+ * @package Votum_Module
7
+ * @author Edward Mateja <edward.mateja@votum.de>
8
+ */
9
+
10
+ class Payone_Licensemanager_Block_Adminhtml_Notification_Toolbar extends Mage_Adminhtml_Block_Notification_Toolbar
11
+ {
12
+ public function isShow()
13
+ {
14
+ $helper = Mage::helper('payone_licensemanager');
15
+ $result = !$helper->isPayoneRegisterd();
16
+ return $result;
17
+ }
18
+
19
+ public function getNoticeMessageText()
20
+ {
21
+ return $this->__('Payone extension is currently disable. Please register this extension to make it active.');
22
+ }
23
+
24
+ public function getNoticeMessageUrl()
25
+ {
26
+
27
+ return Mage::getUrl('payonelicensemanager/active');
28
+ }
29
+
30
+ public function getReadDetailsText()
31
+ {
32
+ return $this->__('Register PAYONE extension');
33
+ }
34
+ }
app/code/community/Payone/Licensemanager/Block/Adminhtml/Notification/Window.php ADDED
@@ -0,0 +1,82 @@