Quickpay_Payment_3 - Version 3.1.0

Version Notes

Der vil kunne forekomme en konflikt med det gamle quickpay modul. Læs eventuelt mere her:

http://www.tric.dk/quickpay-konflikt-mellem-nyt-og-gammelt-modul

Download this release

Release Info

Developer TRIC Solutions
Extension Quickpay_Payment_3
Version 3.1.0
Comparing to
See all releases


Version 3.1.0

Files changed (50) hide show
  1. app/code/local/Quickpay/Payment/Block/Info/Quickpay.php +69 -0
  2. app/code/local/Quickpay/Payment/Block/Payment/Form.php +9 -0
  3. app/code/local/Quickpay/Payment/Block/Payment/Redirect.php +17 -0
  4. app/code/local/Quickpay/Payment/Helper/Data.php +330 -0
  5. app/code/local/Quickpay/Payment/Model/Mysql4/Setup.php +6 -0
  6. app/code/local/Quickpay/Payment/Model/Observer.php +76 -0
  7. app/code/local/Quickpay/Payment/Model/Payment.php +204 -0
  8. app/code/local/Quickpay/Payment/Model/System/Config/Source/Cardlogos.php +24 -0
  9. app/code/local/Quickpay/Payment/Model/System/Config/Source/Cardtype.php +15 -0
  10. app/code/local/Quickpay/Payment/Model/System/Config/Source/Specificcardtypes.php +30 -0
  11. app/code/local/Quickpay/Payment/Model/System/Config/Source/Transactionfees.php +34 -0
  12. app/code/local/Quickpay/Payment/Model/System/Config/Source/Trustedlogos.php +16 -0
  13. app/code/local/Quickpay/Payment/controllers/PaymentController.php +289 -0
  14. app/code/local/Quickpay/Payment/etc/config.xml +188 -0
  15. app/code/local/Quickpay/Payment/etc/system.xml +249 -0
  16. app/code/local/Quickpay/Payment/sql/quickpaypayment_setup/mysql4-install-1.0.0.php +41 -0
  17. app/design/adminhtml/default/default/template/quickpaypayment/info/info.phtml +1 -0
  18. app/design/adminhtml/default/default/template/quickpaypayment/payment/form.phtml +0 -0
  19. app/design/frontend/base/default/layout/Quickpay_Payment.xml +11 -0
  20. app/design/frontend/base/default/template/quickpaypayment/info/default.phtml +2 -0
  21. app/design/frontend/base/default/template/quickpaypayment/info/payment_info.phtml +2 -0
  22. app/design/frontend/base/default/template/quickpaypayment/payment/form (Michael Gregersen's conflicted copy 2012-05-08).phtml +163 -0
  23. app/design/frontend/base/default/template/quickpaypayment/payment/form.phtml +166 -0
  24. app/design/frontend/base/default/template/quickpaypayment/payment/info/payment_info.phtml +2 -0
  25. app/design/frontend/base/default/template/quickpaypayment/payment/redirect/paymentwindow.phtml +103 -0
  26. app/etc/modules/Quickpay_Payment.xml +9 -0
  27. app/locale/da_DK/Quickpay_Payment.csv +95 -0
  28. app/locale/en_US/Quickpay_Payment.csv +94 -0
  29. package.xml +24 -0
  30. skin/adminhtml/default/default/images/quickpaypayment/amex.gif +0 -0
  31. skin/adminhtml/default/default/images/quickpaypayment/cvc_dk.gif +0 -0
  32. skin/adminhtml/default/default/images/quickpaypayment/cvc_master.gif +0 -0
  33. skin/adminhtml/default/default/images/quickpaypayment/dankort.gif +0 -0
  34. skin/adminhtml/default/default/images/quickpaypayment/danskenetbetaling.gif +0 -0
  35. skin/adminhtml/default/default/images/quickpaypayment/diners.gif +0 -0
  36. skin/adminhtml/default/default/images/quickpaypayment/edankort.gif +0 -0
  37. skin/adminhtml/default/default/images/quickpaypayment/euroline.gif +0 -0
  38. skin/adminhtml/default/default/images/quickpaypayment/ewire.gif +0 -0
  39. skin/adminhtml/default/default/images/quickpaypayment/forbrugsforeningen.gif +0 -0
  40. skin/adminhtml/default/default/images/quickpaypayment/jcb.gif +0 -0
  41. skin/adminhtml/default/default/images/quickpaypayment/maestro.gif +0 -0
  42. skin/adminhtml/default/default/images/quickpaypayment/mastercard.gif +0 -0
  43. skin/adminhtml/default/default/images/quickpaypayment/mastercard_securecode.gif +0 -0
  44. skin/adminhtml/default/default/images/quickpaypayment/nets.png +0 -0
  45. skin/adminhtml/default/default/images/quickpaypayment/nordea.gif +0 -0
  46. skin/adminhtml/default/default/images/quickpaypayment/pci.gif +0 -0
  47. skin/adminhtml/default/default/images/quickpaypayment/verisign_secure.gif +0 -0
  48. skin/adminhtml/default/default/images/quickpaypayment/visa.gif +0 -0
  49. skin/adminhtml/default/default/images/quickpaypayment/visa_secure.gif +0 -0
  50. skin/adminhtml/default/default/images/quickpaypayment/visaelectron.gif +0 -0
app/code/local/Quickpay/Payment/Block/Info/Quickpay.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Block_Info_Quickpay extends Mage_Payment_Block_Info
3
+ {
4
+ protected function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->setTemplate('quickpaypayment/info/default.phtml');
8
+
9
+ }
10
+
11
+ public function getInfo()
12
+ {
13
+ $info = $this->getData('info');
14
+ if (!($info instanceof Mage_Payment_Model_Info)) {
15
+ Mage::throwException($this->__('Betalings objektet kan ikke hente information'));
16
+ }
17
+ return $info;
18
+ }
19
+
20
+ public function getQuickpayInfoHtml()
21
+ {
22
+ $res = "";
23
+ if($this->getInfo()->getOrder())
24
+ {
25
+ $read = Mage::getSingleton('core/resource')->getConnection('core_read');
26
+ $row = $this->paymentData = $read->fetchRow("select * from quickpaypayment_order_status where ordernum = " . $this->getInfo()->getOrder()->getIncrementId());
27
+
28
+ if(is_array($row))
29
+ {
30
+ if ($row['status'] >= '1')
31
+ {
32
+ $res .= "<table border='0'>";
33
+ if ($row['transaction'] != '0') {
34
+ $res .= "<tr><td>" . $this->__('Transaktions ID:') . "</td>";
35
+ $res .= "<td>" . $row['transaction'] . "</td></tr>";
36
+ }
37
+
38
+ if ($row['cardtype'] != '0') {
39
+ $res .= "<tr><td>" . $this->__('Korttype:') . "</td>";
40
+ $res .= "<td>" . $row['cardtype'] . "</td></tr>";
41
+ }
42
+ if ($row['currency'] != '0') {
43
+ $res .= "<tr><td>" . $this->__('Valuta:') . "</td>";
44
+ $res .= "<td>" . $row['currency'] . "</td></tr>";
45
+ }
46
+
47
+ $res .= "</table><br>";
48
+ }
49
+ else
50
+ {
51
+ $res .= "<br>" . $this->__('Der er endnu ikke registreret nogen betaling for denne ordre!') . "<br>";
52
+ }
53
+ }
54
+ }
55
+
56
+ return $res;
57
+ }
58
+
59
+ public function getMethod()
60
+ {
61
+ return $this->getInfo()->getMethodInstance();
62
+ }
63
+
64
+ public function toPdf()
65
+ {
66
+ $this->setTemplate('payment/info/pdf/default.phtml');
67
+ return $this->toHtml();
68
+ }
69
+ }
app/code/local/Quickpay/Payment/Block/Payment/Form.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Block_Payment_Form extends Mage_Payment_Block_Form
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->setTemplate('quickpaypayment/payment/form.phtml');
7
+ parent::_construct();
8
+ }
9
+ }
app/code/local/Quickpay/Payment/Block/Payment/Redirect.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Block_Payment_Redirect extends Mage_Core_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+
8
+ $this->setTemplate('quickpaypayment/payment/redirect/paymentwindow.phtml');
9
+
10
+ $payment = Mage::getModel('quickpaypayment/payment');
11
+
12
+ $resource = Mage::getSingleton('core/resource');
13
+ $connection = $resource->getConnection('core_write');
14
+ $table = $resource->getTableName('quickpaypayment_order_status');
15
+ $connection->insert($table, Array('ordernum'=>$payment->getCheckout()->getLastRealOrderId()));
16
+ }
17
+ }
app/code/local/Quickpay/Payment/Helper/Data.php ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ public function capture($payment,$amount,$finalize = false)
6
+ {
7
+ //$invoice = $observer->getInvoice();
8
+ $session = Mage::getSingleton('adminhtml/session');
9
+
10
+ if($payment->getInfoInstance())
11
+ {
12
+ $order = $payment->getInfoInstance()->getOrder();
13
+ }
14
+ else
15
+ {
16
+ $order = $payment->getOrder();
17
+ }
18
+
19
+ $orderid = explode("-",$order->getIncrementId());
20
+
21
+ $resource = Mage::getSingleton('core/resource');
22
+ $connection = $resource->getConnection('core_read');
23
+ $table = $resource->getTableName('quickpaypayment_order_status');
24
+ $qpOrderStatus = $connection->fetchAll("SELECT * FROM $table WHERE ordernum=" . $orderid[0]);
25
+ $qpOrderStatus = $qpOrderStatus[0];
26
+
27
+ $capturedAmount = (isset($qpOrderStatus['capturedAmount']) ? $qpOrderStatus['capturedAmount'] : 0 );
28
+
29
+ if((int)($amount*100) <= ((int)$qpOrderStatus['amount']-(int)$capturedAmount) )
30
+ {
31
+ $qpmd5 = Mage::getStoreConfig('payment/quickpaypayment_payment/md5secret');
32
+ $merchant = Mage::getStoreConfig('payment/quickpaypayment_payment/merchantnumber');
33
+
34
+ $msg = Array(
35
+ 'protocol' => 3,
36
+ 'msgtype' => 'capture',
37
+ 'merchant' => $merchant,
38
+ 'amount' => $amount*100,
39
+ 'transaction' => $qpOrderStatus['transaction'],
40
+ );
41
+
42
+ // DELHÆVNING
43
+ if($order->getTotalDue() == $amount || $qpOrderStatus['cardtype'] != 'dankort' || $finalize)
44
+ {
45
+ $msg['finalize'] = 1;
46
+ }
47
+ else
48
+ {
49
+ $msg['finalize'] = 0;
50
+ }
51
+
52
+ $newCapturedAmount = $capturedAmount + ($amount * 100);
53
+
54
+ $msg['md5check'] = md5($msg['protocol'] . $msg['msgtype'] . $msg['merchant'] . $msg['amount'] . $msg['finalize'] . $msg['transaction'] . $qpmd5);
55
+
56
+ $response = $this->transmit($msg);
57
+
58
+ if($response === "")
59
+ {
60
+ throw new Exception(Mage::helper('quickpaypayment')->__('Tomt svar modtaget fra Quickpay API'));
61
+ }
62
+ elseif($response === false)
63
+ {
64
+ throw new Exception(Mage::helper('quickpaypayment')->__('Ingen svar modtaget fra Quickpay API'));
65
+ }
66
+
67
+ $response = $this->responseToArray($response);
68
+
69
+ if($response['qpstat'] == "000")
70
+ {
71
+ $session->addSuccess(Mage::helper('quickpaypayment')->__('Betalingen er hævet online.'));
72
+ $write = $resource->getConnection('core_write');
73
+ $write->query("UPDATE $table SET " .
74
+ 'status = "' . ((isset($response['state'])) ? $response['state'] : '') . '", ' .
75
+ 'time = "' . ((isset($response['time'])) ? $response['time'] : '') . '", ' .
76
+ 'qpstat = "' . ((isset($response['qpstat'])) ? $response['qpstat'] : '') . '", ' .
77
+ 'qpstatmsg = "' . ((isset($response['qpstatmsg'])) ? $response['qpstatmsg'] : '') . '", ' .
78
+ 'chstat = "' . ((isset($response['chstat'])) ? $response['chstat'] : '') . '", ' .
79
+ 'chstatmsg = "' . ((isset($response['chstatmsg'])) ? $response['chstatmsg'] : '') . '", ' .
80
+ 'splitpayment = "' . ((isset($response['splitpayment'])) ? $response['splitpayment'] : '') . '" ,' .
81
+ 'md5check = "' . ((isset($response['md5check'])) ? $response['md5check'] : '') . '", ' .
82
+ 'capturedAmount = ' . $newCapturedAmount . ' ' .
83
+ 'WHERE ordernum=' . $orderid[0]);
84
+
85
+ $this->createTransaction($order,$msg['transaction'],Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
86
+ }
87
+ else
88
+ {
89
+ throw new Exception("Quickpay Response: " . $response['qpstatmsg']);
90
+ }
91
+ }
92
+ else
93
+ {
94
+ throw new Exception(Mage::helper('quickpaypayment')->__('Der forsøges at hæve et højere beløb en tilladt'));
95
+ }
96
+ }
97
+
98
+ public function refund($orderid,$refundtotal)
99
+ {
100
+ $order = Mage::getModel('sales/order')->load($orderid);
101
+ $orderid = explode("-",$order->getIncrementId());
102
+
103
+ $session = Mage::getSingleton('adminhtml/session');
104
+ $resource = Mage::getSingleton('core/resource');
105
+ $connection = $resource->getConnection('core_read');
106
+ $table = $resource->getTableName('quickpaypayment_order_status');
107
+ $qpOrderStatus = $connection->fetchAll("SELECT * FROM $table WHERE ordernum=" . $orderid[0]);
108
+ $qpOrderStatus = $qpOrderStatus[0];
109
+
110
+ $qpmd5 = Mage::getStoreConfig('payment/quickpaypayment_payment/md5secret');
111
+ $merchant = Mage::getStoreConfig('payment/quickpaypayment_payment/merchantnumber');
112
+
113
+ if($refundtotal < 0)
114
+ {
115
+ $refundtotal = $refundtotal*-1;
116
+ }
117
+
118
+ if(($refundtotal*100) <= $qpOrderStatus['capturedAmount'])
119
+ {
120
+ $msg = Array(
121
+ 'protocol' => 3,
122
+ 'msgtype' => 'refund',
123
+ 'merchant' => $merchant,
124
+ 'amount' => $refundtotal*100,
125
+ 'transaction' => $qpOrderStatus['transaction'],
126
+ );
127
+ $msg['md5check'] = md5($msg['protocol'] . $msg['msgtype'] . $msg['merchant'] . $msg['amount'] . $msg['transaction'] . $qpmd5);
128
+
129
+
130
+ $response = Mage::helper('quickpaypayment')->transmit($msg);
131
+
132
+
133
+ ////////////////////////////////////////////////////////////////////////
134
+ ////////////////////////////////////////////////////////////////////////
135
+ ////////////////////////////////////////////////////////////////////////
136
+ ////////////////////////////////////////////////////////////////////////
137
+ /////////////// GRIB DEN RIGTIGE EXCEPTION ////////////
138
+ ////////////////////////////////////////////////////////////////////////
139
+ ////////////////////////////////////////////////////////////////////////
140
+ ////////////////////////////////////////////////////////////////////////
141
+ ////////////////////////////////////////////////////////////////////////
142
+
143
+ // NO RESPONCE - API HUSK TILFØJ IP
144
+ if($response === "")
145
+ {
146
+ throw new Exception(Mage::helper('quickpaypayment')->__('Tomt svar modtaget fra Quickpay API'));
147
+ }
148
+ if($response === false)
149
+ {
150
+ throw new Exception(Mage::helper('quickpaypayment')->__('Ingen svar modtaget fra Quickpay API'));
151
+ }
152
+
153
+
154
+ $response = Mage::helper('quickpaypayment')->responseToArray($response);
155
+
156
+ if($response['qpstat'] == "000")
157
+ {
158
+ $session->addSuccess(Mage::helper('quickpaypayment')->__('Kreditnota refunderet online'));
159
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
160
+ $write->query("UPDATE $table SET ".
161
+ 'refundedAmount = ' . ($refundtotal*100) . ', ' .
162
+ 'status = "'.((isset($response['state'])) ? $response['state'] : '0').'", ' .
163
+ 'time = "' . ((isset($response['time'])) ? $response['time'] : '0') . '", '.
164
+ 'qpstat = "'.((isset($response['qpstat'])) ? $response['qpstat'] : '0').'", ' .
165
+ 'qpstatmsg = "'.((isset($response['qpstatmsg'])) ? $response['qpstatmsg'] : '0').'", ' .
166
+ 'chstat = "'.((isset($response['chstat'])) ? $response['chstat'] : '0').'", ' .
167
+ 'chstatmsg = "'.((isset($response['chstatmsg'])) ? $response['chstatmsg'] : '0').'" ' .
168
+ 'WHERE ordernum=' . $orderid[0]);
169
+
170
+ $this->createTransaction($order,$msg['transaction'],Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND);
171
+
172
+
173
+ }
174
+ else
175
+ {
176
+ throw new Exception($response['qpstatmsg']);
177
+ }
178
+ }
179
+ else
180
+ {
181
+ throw new Exception(Mage::helper('quickpaypayment')->__('Max beløb der kan refunderes: %s',$qpOrderStatus['capturedAmount']));
182
+ }
183
+
184
+ $order->addStatusToHistory($order->getStatus(), Mage::helper('quickpaypayment')->__('Kreditnota refunderede % online', number_format($refundtotal,2,",","")), false);
185
+ $order->save();
186
+ }
187
+
188
+ public function cancel($orderid)
189
+ {
190
+ $order = Mage::getModel('sales/order')->load($orderid);
191
+ $orderid = explode("-",$order->getIncrementId());
192
+
193
+ $session = Mage::getSingleton('adminhtml/session');
194
+ $resource = Mage::getSingleton('core/resource');
195
+ $connection = $resource->getConnection('core_read');
196
+ $table = $resource->getTableName('quickpaypayment_order_status');
197
+ $qpOrderStatus = $connection->fetchAll("SELECT * FROM $table WHERE ordernum=" . $orderid[0]);
198
+ $qpOrderStatus = $qpOrderStatus[0];
199
+
200
+ $qpmd5 = Mage::getStoreConfig('payment/quickpaypayment_payment/md5secret');
201
+ $merchant = Mage::getStoreConfig('payment/quickpaypayment_payment/merchantnumber');
202
+
203
+ $msg = Array(
204
+ 'protocol' => 4,
205
+ 'msgtype' => 'cancel',
206
+ 'merchant' => $merchant,
207
+ 'transaction' => $qpOrderStatus['transaction'],
208
+ );
209
+ $msg['md5check'] = md5($msg['protocol'] . $msg['msgtype'] . $msg['merchant'] . $msg['transaction'] . $qpmd5);
210
+
211
+ $response = Mage::helper('quickpaypayment')->transmit($msg);
212
+
213
+ // NO RESPONCE - API HUSK TILFØJ IP
214
+ if($response === "")
215
+ {
216
+ throw new Exception(Mage::helper('quickpaypayment')->__('Tomt svar modtaget fra Quickpay API'));
217
+ }
218
+ if($response === false)
219
+ {
220
+ throw new Exception(Mage::helper('quickpaypayment')->__('Ingen svar modtaget fra Quickpay API'));
221
+ }
222
+
223
+ $response = Mage::helper('quickpaypayment')->responseToArray($response);
224
+
225
+ if($response['qpstat'] == "000")
226
+ {
227
+ $session->addSuccess(Mage::helper('quickpaypayment')->__('Betalingen blev annulleret online'));
228
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
229
+
230
+ $write->query("UPDATE $table SET ".
231
+ 'status = "'.((isset($response['state'])) ? $response['state'] : '0').'", ' .
232
+ 'time = "' . ((isset($response['time'])) ? $response['time'] : '0') . '", '.
233
+ 'qpstat = "'.((isset($response['qpstat'])) ? $response['qpstat'] : '0').'", ' .
234
+ 'qpstatmsg = "'.((isset($response['qpstatmsg'])) ? $response['qpstatmsg'] : '0').'", ' .
235
+ 'chstat = "'.((isset($response['chstat'])) ? $response['chstat'] : '0').'", ' .
236
+ 'chstatmsg = "'.((isset($response['chstatmsg'])) ? $response['chstatmsg'] : '0').'" ' .
237
+ 'WHERE ordernum=' . $orderid[0]);
238
+ }
239
+ else
240
+ {
241
+ throw new Exception($response['qpstatmsg']);
242
+ }
243
+
244
+ $order->addStatusToHistory($order->getStatus(), Mage::helper('quickpaypayment')->__('Betalingen blev annulleret online'), false);
245
+ $order->save();
246
+ }
247
+
248
+
249
+ public function createTransaction($order,$transactionId,$type)
250
+ {
251
+ $transaction = Mage::getModel('sales/order_payment_transaction');
252
+ $transaction->setOrderPaymentObject($order->getPayment());
253
+
254
+ if(!$transaction = $transaction->loadByTxnId($transactionId))
255
+ {
256
+ $transaction = Mage::getModel('sales/order_payment_transaction');
257
+ $transaction->setOrderPaymentObject($order->getPayment());
258
+ $transaction->setOrder($order);
259
+ }
260
+ if($type == Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH)
261
+ {
262
+ $transaction->setIsClosed(false);
263
+ }
264
+ else
265
+ {
266
+ $transaction->setIsClosed(true);
267
+ }
268
+
269
+ $transaction->setTxnId($transactionId);
270
+ $transaction->setTxnType($type);
271
+ $transaction->save();
272
+
273
+ return $transaction;
274
+ }
275
+
276
+
277
+ public function transmit(Array $msg)
278
+ {
279
+ $context = stream_context_create(
280
+ array(
281
+ 'http' => array(
282
+ 'method' => 'POST',
283
+ 'content' => http_build_query($msg, false, '&'),
284
+ ),
285
+ )
286
+ );
287
+
288
+ if (!$fp = @fopen('https://secure.quickpay.dk/api', 'r', false, $context)) {
289
+ throw new Exception('Could not connect to gateway');
290
+ }
291
+
292
+ if (($response = @stream_get_contents($fp)) === false) {
293
+ throw new Exception('Could not read data from gateway');
294
+ }
295
+
296
+ return $response;
297
+ }
298
+
299
+
300
+ /**
301
+ * Converts QuickPay XML response to an array
302
+ *
303
+ * @param string $response
304
+ * @return array
305
+ */
306
+ public function responseToArray($response) {
307
+ // Load XML in response into DOM
308
+ $result = array();
309
+ $dom = new DOMDocument();
310
+ $dom->loadXML($response);
311
+ // Find elements en response and put them in an associative array
312
+ $xpath = new DOMXPath($dom);
313
+ $elements = $xpath->query('/response/*');
314
+ foreach ($elements as $cn) {
315
+ // If the element has (real) children - this is the case for status->history and chstatus->entry
316
+ if ($cn->childNodes->length > 1) {
317
+ foreach ($cn->childNodes as $hn) {
318
+ $result[$cn->nodeName][intval($i)][$hn->nodeName] = $hn->nodeValue;
319
+ }
320
+ $i++;
321
+ } else {
322
+ $result[$cn->nodeName] = $cn->nodeValue;
323
+ }
324
+ }
325
+
326
+ return $result;
327
+ }
328
+
329
+
330
+ }
app/code/local/Quickpay/Payment/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Model_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
3
+ {
4
+
5
+ }
6
+ ?>
app/code/local/Quickpay/Payment/Model/Observer.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Model_Observer
3
+ {
4
+ public function capture($observer)
5
+ {
6
+ $session = Mage::getSingleton('adminhtml/session');
7
+
8
+ try
9
+ {
10
+ $payment = $observer->getPayment()->getMethodInstance();
11
+
12
+ if(get_class($payment) == "Quickpay_Payment_Model_Payment")
13
+ {
14
+ $invoice = $observer->getInvoice();
15
+ Mage::helper('quickpaypayment')->capture($payment,$invoice->getGrandTotal());
16
+ $payment->processInvoice($invoice,$payment);
17
+ }
18
+ else
19
+ {
20
+ throw new Exception(Mage::helper('quickpaypayment')->__('Ikke en Quickpay Betaling'));
21
+ }
22
+ }
23
+ catch(Exception $e)
24
+ {
25
+ $session->addException($e, Mage::helper('quickpaypayment')->__('Ikke muligt at hæve betalingen online, grundet denne fejl: %s', $e->getMessage()));
26
+ //throw new Exception("Failed to create Invoice on online capture");
27
+ }
28
+
29
+ return $this;
30
+ }
31
+
32
+
33
+ public function refund($observer)
34
+ {
35
+ $session = Mage::getSingleton('adminhtml/session');
36
+
37
+ try
38
+ {
39
+ $creditmemo = $observer->getEvent()->getCreditmemo();
40
+ $refundtotal = $creditmemo->getGrandTotal();
41
+
42
+ Mage::helper('quickpaypayment')->refund($creditmemo->getOrderId(),$refundtotal);
43
+
44
+ }
45
+ catch(Exception $e)
46
+ {
47
+ $session->addException($e, Mage::helper('quickpaypayment')->__('Ikke muligt at refundere betalingen online, grundet denne fejl: %s',$e->getMessage()));
48
+ }
49
+ return $this;
50
+ }
51
+
52
+ public function cancel($observer)
53
+ {
54
+ $session = Mage::getSingleton('adminhtml/session');
55
+
56
+ try
57
+ {
58
+ $order = $observer->getEvent()->getOrder();
59
+
60
+ Mage::helper('quickpaypayment')->cancel($order->getId());
61
+
62
+ }
63
+ catch(Exception $e)
64
+ {
65
+ $session->addException($e, Mage::helper('quickpaypayment')->__('Ikke muligt at annullerer betalingen online, grundet denne fejl: %s',$e->getMessage()));
66
+ }
67
+ return $this;
68
+ }
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ }
app/code/local/Quickpay/Payment/Model/Payment.php ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Model_Payment extends Mage_Payment_Model_Method_Abstract
3
+ {
4
+
5
+ const PAYMENT_TYPE_AUTH = 'AUTHORIZATION';
6
+ const PAYMENT_TYPE_SALE = 'SALE';
7
+
8
+ //protected $_canCapturePartial = true;
9
+ protected $_code = 'quickpaypayment_payment';
10
+ protected $_formBlockType = 'quickpaypayment/payment_form';
11
+ protected $_infoBlockType = 'quickpaypayment/info_quickpay';
12
+ //
13
+ // Allowed currency types
14
+ //
15
+ protected $_allowCurrencyCode = array(
16
+ 'ADP','AED','AFA','ALL','AMD','ANG','AOA','ARS','AUD','AWG','AZM','BAM','BBD','BDT','BGL','BGN','BHD','BIF','BMD','BND','BOB',
17
+ 'BOV','BRL','BSD','BTN','BWP','BYR','BZD','CAD','CDF','CHF','CLF','CLP','CNY','COP','CRC','CUP','CVE','CYP','CZK','DJF','DKK',
18
+ 'DOP','DZD','ECS','ECV','EEK','EGP','ERN','ETB','EUR','FJD','FKP','GBP','GEL','GHC','GIP','GMD','GNF','GTQ','GWP','GYD','HKD',
19
+ 'HNL','HRK','HTG','HUF','IDR','ILS','INR','IQD','IRR','ISK','JMD','JOD','JPY','KES','KGS','KHR','KMF','KPW','KRW','KWD','KYD',
20
+ 'KZT','LAK','LBP','LKR','LRD','LSL','LTL','LVL','LYD','MAD','MDL','MGF','MKD','MMK','MNT','MOP','MRO','MTL','MUR','MVR','MWK',
21
+ 'MXN','MXV','MYR','MZM','NAD','NGN','NIO','NOK','NPR','NZD','OMR','PAB','PEN','PGK','PHP','PKR','PLN','PYG','QAR','ROL','RUB',
22
+ 'RUR','RWF','SAR','SBD','SCR','SDD','SEK','SGD','SHP','SIT','SKK','SLL','SOS','SRG','STD','SVC','SYP','SZL','THB','TJS','TMM',
23
+ 'TND','TOP','TPE','TRL','TRY','TTD','TWD','TZS','UAH','UGX','USD','UYU','UZS','VEB','VND','VUV','XAF','XCD','XOF','XPF','YER',
24
+ 'YUM','ZAR','ZMK','ZWD'
25
+ );
26
+
27
+
28
+ public function canRefund()
29
+ {
30
+ return true;
31
+ }
32
+
33
+ public function canEdit()
34
+ {
35
+ return true;
36
+ }
37
+
38
+ public function canCapture()
39
+ {
40
+ return true;
41
+ }
42
+
43
+ public function canUseForMultishipping()
44
+ {
45
+ return false;
46
+ }
47
+
48
+ public function getSession()
49
+ {
50
+ return Mage::getSingleton('quickpaypayment/session');
51
+ }
52
+
53
+ public function getCheckout()
54
+ {
55
+ return Mage::getSingleton('checkout/session');
56
+ }
57
+
58
+ // Calculates if integrated layout is used or not
59
+ // If not just redirect to a page where the payment window is opened
60
+ public function getOrderPlaceRedirectUrl()
61
+ {
62
+ return Mage::getUrl('quickpaypayment/payment/redirect');
63
+ }
64
+
65
+ public function getQuote()
66
+ {
67
+ return $this->getCheckout()->getQuote();
68
+ }
69
+
70
+ public function canUseInternal()
71
+ {
72
+ // Må kun bruges når der redigeres i en order
73
+ if(Mage::app()->getFrontController()->getAction() instanceof Mage_Adminhtml_Sales_Order_EditController)
74
+ {
75
+ // Her kunne testes om det i forvejen er en Quickpay order.
76
+ // med noget i stilen af Mage::getSingleton('adminhtml/session_quote')->getOrder()
77
+ return true;
78
+ }
79
+ return false;
80
+ }
81
+
82
+ // Perhaps this can be used to make payments before the order is created
83
+ public function createFormBlock($name)
84
+ {
85
+ $block = $this->getLayout()
86
+ ->createBlock('quickpaypayment/payment_form', $name)
87
+ ->setMethod('quickpaypayment_payment')
88
+ ->setPayment($this->getPayment())
89
+ ->setTemplate('quickpaypayment/payment/form.phtml');
90
+
91
+ return $block;
92
+ }
93
+
94
+ /*validate the currency code is avaialable to use for Quickpay or not*/
95
+ public function validate()
96
+ {
97
+ parent::validate();
98
+
99
+ if(!Mage::app()->getFrontController()->getAction() instanceof Mage_Adminhtml_Sales_Order_EditController)
100
+ {
101
+ $currency_code = $this->getQuote()->getBaseCurrencyCode();
102
+ if (!in_array($currency_code,$this->_allowCurrencyCode))
103
+ {
104
+ Mage::throwException(Mage::helper('quickpaypayment')->__('Valutakoden (%s) er ikke kompatible med Quickpay',$currency_code));
105
+ }
106
+ }
107
+ return $this;
108
+ }
109
+
110
+ /*
111
+ public function onOrderValidate(Mage_Sales_Model_Order_Payment $payment)
112
+ {
113
+ return $this;
114
+ }
115
+ */
116
+
117
+ public function calcLanguage($lan)
118
+ {
119
+ $splitted = explode('_',$lan);
120
+ return $splitted[0];
121
+ }
122
+
123
+ // Calculates if any of the trusted logos are to be shown - in that case return true
124
+ public function showTrustedList()
125
+ {
126
+ $logoArray = explode(',', $this->getConfigData('trustedlogos'));
127
+ foreach($logoArray as $item)
128
+ {
129
+ if ($item == 'verisign_secure' ||
130
+ $item == 'mastercard_securecode' ||
131
+ $item == 'pci' ||
132
+ $item == 'nets' ||
133
+ $item == 'euroline')
134
+ {
135
+ return true;
136
+ }
137
+ }
138
+ return false;
139
+ }
140
+
141
+
142
+ // Calculates if any of the card logos are to be shown - in that case return true
143
+ public function showCardsList()
144
+ {
145
+ $logoArray = explode(',', $this->getConfigData('cardlogos'));
146
+ foreach($logoArray as $item)
147
+ {
148
+ if ($item == 'dankort' ||
149
+ $item == 'edankort' ||
150
+ $item == 'danskenetbetaling' ||
151
+ $item == 'nordea' ||
152
+ $item == 'ewire' ||
153
+ $item == 'forbrugsforeningen' ||
154
+ $item == 'visa' ||
155
+ $item == 'visaelectron' ||
156
+ $item == 'mastercard' ||
157
+ $item == 'maestro' ||
158
+ $item == 'jcb' ||
159
+ $item == 'diners' ||
160
+ $item == 'amex')
161
+ {
162
+ return true;
163
+ }
164
+ }
165
+ return false;
166
+ }
167
+
168
+
169
+ public function canCapturePartial()
170
+ {
171
+ $orderid = $this->getInfoInstance()->getOrder()->getIncrementId();
172
+ $orderid = explode("-",$orderid);
173
+ $resource = Mage::getSingleton('core/resource');
174
+ $table = $resource->getTableName('quickpaypayment_order_status');
175
+ $read = $resource->getConnection('core_read');
176
+
177
+ $row = $read->fetchRow("SELECT cardtype FROM $table WHERE ordernum = '" . $orderid[0] . "'");
178
+ if($row['cardtype'] == 'dankort' || Mage::app()->getFrontController()->getAction() instanceof Mage_Adminhtml_Sales_Order_CreditmemoController)
179
+ {
180
+ return true;
181
+ }
182
+
183
+ return false;
184
+ }
185
+
186
+ public function getTitle()
187
+ {
188
+ // Tilføjer max beløb hvis vi er ved at ændre en order.
189
+ if(Mage::app()->getFrontController()->getAction() instanceof Mage_Adminhtml_Sales_Order_EditController)
190
+ {
191
+ $orderid = Mage::getSingleton('adminhtml/session_quote')->getOrder()->getIncrementId();
192
+ $orderid = explode("-",$orderid);
193
+
194
+ $resource = Mage::getSingleton('core/resource');
195
+ $table = $resource->getTableName('quickpaypayment_order_status');
196
+ $read = $resource->getConnection('core_read');
197
+ $row = $read->fetchRow("SELECT amount, currency FROM $table WHERE ordernum = '" . $orderid[0] . "'");
198
+
199
+ return $this->getConfigData('title') . " - " . Mage::helper('quickpaypayment')->__('Maks beløb:') . " " . $row['amount']/100 . " " . $row['currency'];
200
+ }
201
+ return $this->getConfigData('title');
202
+ }
203
+
204
+ }
app/code/local/Quickpay/Payment/Model/System/Config/Source/Cardlogos.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Model_System_Config_Source_Cardlogos
3
+ {
4
+
5
+ public function toOptionArray()
6
+ {
7
+ return array(
8
+ array('value'=>'dankort', 'label'=>Mage::helper('quickpaypayment')->__('Dankort')),
9
+ array('value'=>'edankort', 'label'=>Mage::helper('quickpaypayment')->__('eDankort')),
10
+ array('value'=>'danskenetbetaling', 'label'=>Mage::helper('quickpaypayment')->__('Danske Netbetaling')),
11
+ array('value'=>'nordea', 'label'=>Mage::helper('quickpaypayment')->__('Nordea e-betaling')),
12
+ array('value'=>'ewire', 'label'=>Mage::helper('quickpaypayment')->__('EWIRE')),
13
+ array('value'=>'forbrugsforeningen', 'label'=>Mage::helper('quickpaypayment')->__('Forbrugsforeningen')),
14
+ array('value'=>'visa', 'label'=>Mage::helper('quickpaypayment')->__('VISA')),
15
+ array('value'=>'visaelectron', 'label'=>Mage::helper('quickpaypayment')->__('VISA Electron')),
16
+ array('value'=>'mastercard', 'label'=>Mage::helper('quickpaypayment')->__('MasterCard')),
17
+ array('value'=>'maestro', 'label'=>Mage::helper('quickpaypayment')->__('Maestro')),
18
+ array('value'=>'jcb', 'label'=>Mage::helper('quickpaypayment')->__('JCB')),
19
+ array('value'=>'diners', 'label'=>Mage::helper('quickpaypayment')->__('Diners Club')),
20
+ array('value'=>'amex', 'label'=>Mage::helper('quickpaypayment')->__('AMEX')),
21
+ );
22
+ }
23
+
24
+ }
app/code/local/Quickpay/Payment/Model/System/Config/Source/Cardtype.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QuickPay_Payment_Model_System_Config_Source_Cardtype
4
+ {
5
+
6
+ public function toOptionArray()
7
+ {
8
+ return array(
9
+ array('value'=>'', 'label'=>Mage::helper('quickpaypayment')->__('Alle betalingsmetoder')),
10
+ array('value'=>'creditcard', 'label'=>Mage::helper('quickpaypayment')->__('Alle kreditkort')),
11
+ array('value'=>'specific-cards', 'label'=>Mage::helper('quickpaypayment')->__('Vælg specifikke betalingsmetoder')),
12
+ );
13
+ }
14
+
15
+ }
app/code/local/Quickpay/Payment/Model/System/Config/Source/Specificcardtypes.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QuickPay_Payment_Model_System_Config_Source_Specificcardtypes
4
+ {
5
+
6
+ public function toOptionArray()
7
+ {
8
+ return array(
9
+ array('value'=>'american-express', 'label'=>Mage::helper('quickpaypayment')->__('American Express')),
10
+ array('value'=>'american-express-dk', 'label'=>Mage::helper('quickpaypayment')->__('American Express (udstedt i Danmark)')),
11
+ array('value'=>'dankort', 'label'=>Mage::helper('quickpaypayment')->__('Dankort')),
12
+ array('value'=>'danske-dk', 'label'=>Mage::helper('quickpaypayment')->__('Danske Net Bank')),
13
+ array('value'=>'diners', 'label'=>Mage::helper('quickpaypayment')->__('Diners Club')),
14
+ array('value'=>'diners-dk', 'label'=>Mage::helper('quickpaypayment')->__('Diners Club (udstedt i Danmark)')),
15
+ array('value'=>'edankort', 'label'=>Mage::helper('quickpaypayment')->__('eDankort')),
16
+ array('value'=>'fbg1886', 'label'=>Mage::helper('quickpaypayment')->__('Forbrugsforeningen af 1886')),
17
+ array('value'=>'jcb', 'label'=>Mage::helper('quickpaypayment')->__('JCB')),
18
+ array('value'=>'mastercard', 'label'=>Mage::helper('quickpaypayment')->__('Mastercard')),
19
+ array('value'=>'mastercard-dk', 'label'=>Mage::helper('quickpaypayment')->__('Mastercard (udstedt i Danmark)')),
20
+ array('value'=>'mastercard-debet-dk', 'label'=>Mage::helper('quickpaypayment')->__('Mastercard Debet (udstedt i Danmark)')),
21
+ array('value'=>'nordea-dk', 'label'=>Mage::helper('quickpaypayment')->__('Nordea Net Bank')),
22
+ array('value'=>'visa', 'label'=>Mage::helper('quickpaypayment')->__('Visa')),
23
+ array('value'=>'visa-dk', 'label'=>Mage::helper('quickpaypayment')->__('Visa (udstedt i Danmark)')),
24
+ array('value'=>'visa-electron', 'label'=>Mage::helper('quickpaypayment')->__('Visa Electron')),
25
+ array('value'=>'visa-electron-dk', 'label'=>Mage::helper('quickpaypayment')->__('Visa Electron (udstedt i Danmark)')),
26
+ array('value'=>'paypal', 'label'=>Mage::helper('quickpaypayment')->__('PayPal')),
27
+ );
28
+ }
29
+
30
+ }
app/code/local/Quickpay/Payment/Model/System/Config/Source/Transactionfees.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Quickpay_Payment_Model_System_Config_Source_Transactionfees
4
+ {
5
+
6
+ public function toOptionArray()
7
+ {
8
+ return array(
9
+ // DANSKE
10
+ array('value'=>'american-express-dk', 'label'=>Mage::helper('quickpaypayment')->__('American Express (Dansk)')),
11
+ array('value'=>'dankort', 'label'=>Mage::helper('quickpaypayment')->__('Dankort')),
12
+ array('value'=>'diners-dk', 'label'=>Mage::helper('quickpaypayment')->__('Diners (Dansk)')),
13
+ array('value'=>'edankort', 'label'=>Mage::helper('quickpaypayment')->__('edankort')),
14
+ array('value'=>'maestro-dk', 'label'=>Mage::helper('quickpaypayment')->__('Maestro (Dansk)')),
15
+ array('value'=>'mastercard-dk', 'label'=>Mage::helper('quickpaypayment')->__('Mastercard (Dansk)')),
16
+ array('value'=>'mastercard-debet-dk', 'label'=>Mage::helper('quickpaypayment')->__('Mastercard debit (Dansk)')),
17
+ array('value'=>'visa-dk', 'label'=>Mage::helper('quickpaypayment')->__('Visa (Dansk)')),
18
+ array('value'=>'visa-electron-dk', 'label'=>Mage::helper('quickpaypayment')->__('Visa Electron (Dansk)')),
19
+ array('value'=>'fbg1886', 'label'=>Mage::helper('quickpaypayment')->__('Forbrugsforeningen')),
20
+
21
+ // UDENLANSKE
22
+ array('value'=>'american-express', 'label'=>Mage::helper('quickpaypayment')->__('American Express')),
23
+ array('value'=>'diners', 'label'=>Mage::helper('quickpaypayment')->__('Diners')),
24
+ array('value'=>'jcb', 'label'=>Mage::helper('quickpaypayment')->__('JCB')),
25
+ array('value'=>'maestro', 'label'=>Mage::helper('quickpaypayment')->__('Maestro')),
26
+ array('value'=>'mastercard', 'label'=>Mage::helper('quickpaypayment')->__('Mastercard')),
27
+ array('value'=>'visa', 'label'=>Mage::helper('quickpaypayment')->__('Visa')),
28
+ array('value'=>'visa-electron', 'label'=>Mage::helper('quickpaypayment')->__('Visa Electron'))
29
+
30
+
31
+ );
32
+ }
33
+
34
+ }
app/code/local/Quickpay/Payment/Model/System/Config/Source/Trustedlogos.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_Model_System_Config_Source_Trustedlogos
3
+ {
4
+
5
+ public function toOptionArray()
6
+ {
7
+ return array(
8
+ array('value'=>'verisign_secure', 'label'=>Mage::helper('quickpaypayment')->__('Verified by VISA')),
9
+ array('value'=>'mastercard_securecode', 'label'=>Mage::helper('quickpaypayment')->__('MasterCard Secure Code')),
10
+ array('value'=>'pci', 'label'=>Mage::helper('quickpaypayment')->__('PCI')),
11
+ array('value'=>'nets', 'label'=>Mage::helper('quickpaypayment')->__('Nets')),
12
+ array('value'=>'euroline', 'label'=>Mage::helper('quickpaypayment')->__('Euroline')),
13
+ );
14
+ }
15
+
16
+ }
app/code/local/Quickpay/Payment/controllers/PaymentController.php ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Quickpay_Payment_PaymentController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ // Flag only used for callback
5
+ protected $_callbackAction = false;
6
+
7
+ protected function _expireAjax()
8
+ {
9
+ if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
10
+ $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
11
+ exit;
12
+ }
13
+ }
14
+
15
+ public function getPayment()
16
+ {
17
+ return Mage::getSingleton('quickpaypayment/payment');
18
+ }
19
+
20
+ public function redirectAction()
21
+ {
22
+ $incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
23
+
24
+ $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
25
+ $order->addStatusToHistory(
26
+ Mage::getModel('quickpaypayment/payment')->getConfigData('order_status_before_payment'),
27
+ $this->__("Ordren er oprettet og afventer betaling.")
28
+ );
29
+
30
+ $order->save();
31
+
32
+ if((int)Mage::getStoreConfig('cataloginventory/options/can_subtract') == 1 && (int)Mage::getStoreConfig('cataloginventory/item_options/manage_stock') == 1)
33
+ {
34
+ $resource = Mage::getSingleton('core/resource');
35
+ $connection = $resource->getConnection('core_read');
36
+ $table = $resource->getTableName('quickpaypayment_order_status');
37
+ // Tester om varene er trukket allerede.
38
+ if(count($connection->fetchAll("SELECT id FROM $table WHERE ordernum = '$incrementId'")) == 0)
39
+ {
40
+ $this->addToStock($incrementId);
41
+ }
42
+ }
43
+
44
+ $block = Mage::getSingleton('core/layout')->createBlock('quickpaypayment/payment_redirect');
45
+ $block->toHTML();
46
+ }
47
+
48
+ public function addToStock($incrementId)
49
+ {
50
+ $payment = Mage::getModel('quickpaypayment/payment');
51
+ $session = Mage::getSingleton('checkout/session');
52
+
53
+ if (((int)$payment->getConfigData('handlestock')) == 1)
54
+ {
55
+ if(!isset($_SESSION['stock_removed']) || $_SESSION['stock_removed'] != $session->getLastRealOrderId())
56
+ {
57
+ $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);
58
+ $items = $order->getAllItems(); // Get all items from the order
59
+ if ($items)
60
+ {
61
+ foreach($items as $item)
62
+ {
63
+ $quantity = $item->getQtyOrdered(); // get Qty ordered
64
+ $product_id = $item->getProductId(); // get it's ID
65
+
66
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id); // Load the stock for this product
67
+ $stock->setQty($stock->getQty()+$quantity); // Set to new Qty
68
+ $stock->setIsInStock(true);
69
+ $stock->save(); // Save
70
+ }
71
+ }
72
+
73
+ //
74
+ // Flag so that stock is only updated once!
75
+ //
76
+ $_SESSION['stock_removed'] = $session->getLastRealOrderId();
77
+ }
78
+ }
79
+ }
80
+
81
+ public function removeFromStock($incrementId)
82
+ {
83
+ $payment = Mage::getModel('quickpaypayment/payment');
84
+ $session = Mage::getSingleton('checkout/session');
85
+
86
+ if (((int)$payment->getConfigData('handlestock')) == 1)
87
+ {
88
+ $order = Mage::getModel('sales/order')->load($incrementId);
89
+ $items = $order->getAllItems(); // Get all items from the order
90
+ if($items)
91
+ {
92
+ foreach($items as $item)
93
+ {
94
+ $quantity = $item->getQtyOrdered(); // get Qty ordered
95
+ $product_id = $item->getProductId(); // get it's ID
96
+
97
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product_id); // Load the stock for this product
98
+ $stock->setQty($stock->getQty()-$quantity); // Set to new Qty
99
+ $stock->save(); // Save
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ public function cancelAction()
106
+ {
107
+ //$session = Mage::getSingleton('checkout/session');
108
+ //$lastQuoteId = $session->getLastQuoteId();
109
+ //$session->unsetAll();
110
+ //$session->setQuoteId($lastQuoteId);
111
+ //$quote = Mage::getModel('sales/quote')->load($session->getLastQuoteId());
112
+ //$session->replaceQuote($quote);
113
+
114
+ //var_dump($session->getQuote()->getData());
115
+ //$session->setCartWasUpdated(true);
116
+
117
+ //$quote = Mage::getModel('sales/quote')->load($session->getLastQuoteId());
118
+ //$session->replaceQuote($quote);
119
+
120
+ $this->_redirect('checkout/cart');
121
+ }
122
+
123
+ public function successAction()
124
+ {
125
+ $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
126
+
127
+ $payment = Mage::getModel('quickpaypayment/payment');
128
+ $order->addStatusToHistory($payment->getConfigData('order_status'));
129
+ $order->save();
130
+
131
+ // CREATES INVOICE if payment instantcapture is ON
132
+ if((int)$payment->getConfigData('instantcapture') == 1 && (int)$payment->getConfigData('instantinvoice') == 1)
133
+ {
134
+ if($order->canInvoice())
135
+ {
136
+ $invoice = $order->prepareInvoice();
137
+ $invoice->register();
138
+
139
+ Mage::getModel('core/resource_transaction')
140
+ ->addObject($invoice)
141
+ ->addObject($invoice->getOrder())
142
+ ->save();
143
+
144
+ $order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);
145
+ $order->save();
146
+ }
147
+ }
148
+
149
+ $this->_redirect('checkout/onepage/success');
150
+ }
151
+
152
+ public function callbackAction()
153
+ {
154
+ $session = Mage::getSingleton('checkout/session');
155
+
156
+ $payment = Mage::getModel('quickpaypayment/payment');
157
+
158
+ $ourCheck = md5(
159
+ $_POST['msgtype'].
160
+ $_POST['ordernumber'].
161
+ $_POST['amount'].
162
+ $_POST['currency'].
163
+ $_POST['time'].
164
+ $_POST['state'].
165
+ $_POST['qpstat'].
166
+ $_POST['qpstatmsg'].
167
+ $_POST['chstat'].
168
+ $_POST['chstatmsg'].
169
+ $_POST['merchant'].
170
+ $_POST['merchantemail'].
171
+ $_POST['transaction'].
172
+ $_POST['cardtype'].
173
+ $_POST['cardnumber'].
174
+ $_POST['splitpayment'].
175
+ $_POST['fraudprobability'].
176
+ $_POST['fraudremarks'].
177
+ $_POST['fraudreport'].
178
+ $_POST['fee'].
179
+ $payment->getConfigData('md5secret')
180
+ );
181
+ if($_POST['md5check'] == $ourCheck)
182
+ {
183
+ $order = Mage::getModel('sales/order')->loadByIncrementId((int)$_POST["ordernumber"]);
184
+
185
+ if((int)$payment->getConfigData('transactionfee') == 1)
186
+ {
187
+ $fee = ((int)$_POST['fee']/100);
188
+ $fee_text = "";
189
+ if((int)$payment->getConfigData('specifytransactionfee') == 1)
190
+ {
191
+ $fee_text = " " . Mage::helper('quickpaypayment')->__("inkl. %s %s i transaktionsgebyr",$fee,$order->getData('order_currency_code'));
192
+ }
193
+
194
+ $order->setShippingDescription($order->getShippingDescription() . $fee_text);
195
+ $order->setShippingAmount($order->getShippingAmount() + $fee);
196
+ $order->setBaseShippingAmount($order->getShippingAmount());
197
+ $order->setGrandTotal($order->getGrandTotal() + $fee);
198
+ $order->setBaseGrandTotal($order->getGrandTotal());
199
+ $order->save();
200
+
201
+ }
202
+
203
+
204
+ // Save the order into the quickpaypayment_order_status table
205
+ // IMPORTANT to update the status as 1 to ensure that the stock is handled correctly!
206
+ // TODO: We sould use quickpays md5check to see if the data have been altered..
207
+
208
+ if($_POST['qpstat'] == "000")
209
+ {
210
+ $resource = Mage::getSingleton('core/resource');
211
+ $table = $resource->getTableName('quickpaypayment_order_status');
212
+
213
+ $query = "UPDATE $table SET " .
214
+ 'transaction = "' . ((isset($_POST['transaction'])) ? $_POST['transaction'] : '') . '", ' .
215
+ 'status = "' . ((isset($_POST['state'])) ? $_POST['state'] : '') . '", ' .
216
+ 'pbsstat = "' . ((isset($_POST['pbsstat'])) ? $_POST['pbsstat'] : '') . '", ' .
217
+ 'qpstat = "' . ((isset($_POST['qpstat'])) ? $_POST['qpstat'] : '') . '", ' .
218
+ 'qpstatmsg = "' . ((isset($_POST['qpstatmsg'])) ? $_POST['qpstatmsg'] : '') . '", ' .
219
+ 'chstat = "' . ((isset($_POST['chstat'])) ? $_POST['chstat'] : '') . '", ' .
220
+ 'chstatmsg = "' . ((isset($_POST['chstatmsg'])) ? $_POST['chstatmsg'] : '') . '", ' .
221
+ 'merchantemail = "' . ((isset($_POST['merchantemail'])) ? $_POST['merchantemail'] : '') . '", ' .
222
+ 'merchant = "' . ((isset($_POST['merchant'])) ? $_POST['merchant'] : '') . '", ' .
223
+ 'amount = "' . ((isset($_POST['amount'])) ? $_POST['amount'] : '') . '", ' .
224
+ 'currency = "' . ((isset($_POST['currency'])) ? $_POST['currency'] : '') . '", ' .
225
+ 'time = "' . ((isset($_POST['time'])) ? $_POST['time'] : '') . '", ' .
226
+ 'md5check = "' . ((isset($_POST['md5check'])) ? $_POST['md5check'] : '') . '", ' .
227
+ 'cardtype = "' . ((isset($_POST['cardtype'])) ? $_POST['cardtype'] : '') . '", ' .
228
+ 'cardnumber = "' . ((isset($_POST['cardnumber'])) ? $_POST['cardnumber'] : '') . '", ' .
229
+ 'splitpayment = "' . ((isset($_POST['splitpayment'])) ? $_POST['splitpayment'] : '') . '", ' .
230
+ 'fraudprobability = "' . ((isset($_POST['fraudprobability'])) ? $_POST['fraudprobability'] : '') . '", ' .
231
+ 'fraudremarks = "' . ((isset($_POST['fraudremarks'])) ? $_POST['fraudremarks'] : '') . '", ' .
232
+ 'fraudreport = "' . ((isset($_POST['fraudreport'])) ? $_POST['fraudreport'] : '') . '", ' .
233
+ 'fee = "' . ((isset($_POST['fee'])) ? $_POST['fee'] : '') . '", ' .
234
+ 'capturedAmount = "0", '.
235
+ 'refundedAmount = "0" '.
236
+ 'where ordernum = "' . $_POST['ordernumber'] . '"';
237
+
238
+
239
+ $write = $resource->getConnection('core_write');
240
+ $write->query($query);
241
+
242
+ if (((int)$payment->getConfigData('sendmailorderconfirmation')) == 1) {
243
+ $order->sendNewOrderEmail();
244
+ }
245
+
246
+
247
+ Mage::helper('quickpaypayment')->createTransaction($order,$_POST['transaction'],Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
248
+
249
+ }
250
+ else
251
+ {
252
+ $msg = "Der er fejl ved et betalings forsoeg:<br/>";
253
+ $msg .= "Info: <br/>";
254
+ $msg .= "pbsstat: " . ((isset($_POST['pbsstat'])) ? $_POST['pbsstat'] : '') . "<br/>";
255
+ $msg .= "qpstat: " . ((isset($_POST['qpstat'])) ? $_POST['qpstat'] : '') . "<br/>";
256
+ $msg .= "qpmsg: " . ((isset($_POST['qpstatmsg'])) ? $_POST['qpstatmsg'] : '') . "<br/>";
257
+ $msg .= "chstat: " . ((isset($_POST['chstat'])) ? $_POST['chstat'] : '') . "<br/>";
258
+ $msg .= "chstatmsg: " . ((isset($_POST['chstatmsg'])) ? $_POST['chstatmsg'] : '') . "<br/>";
259
+ $msg .= "merchantemail: " . ((isset($_POST['merchantemail'])) ? $_POST['merchantemail'] : '') . "<br/>";
260
+ $msg .= "merchant: " . ((isset($_POST['merchant'])) ? $_POST['merchant'] : '') . "<br/>";
261
+ $msg .= "amount: " . ((isset($_POST['amount'])) ? $_POST['amount'] : '') . "<br/>";
262
+ $msg .= "currency: " . ((isset($_POST['currency'])) ? $_POST['currency'] : '') . "<br/>";
263
+ $msg .= "cardtype: " . ((isset($_POST['cardtype'])) ? $_POST['cardtype'] : '') . "<br/>";
264
+
265
+ //Mage::log($msg);
266
+ $order->addStatusToHistory($order->getStatus(),$msg);
267
+ $order->save();
268
+ }
269
+
270
+ // Remove items from stock if either not yet removed or only if stock handling is enabled
271
+ if ($_POST['qpstat'] == "000" && $_POST['state'] == '1') {
272
+ // Remove items from stock as the payment now has been made
273
+ if((int)Mage::getStoreConfig('cataloginventory/item_options/manage_stock') == 1)
274
+ {
275
+ $this->removeFromStock($order->getIncrementId());
276
+ }
277
+ }
278
+ }
279
+ else
280
+ {
281
+ header("Error: MD5 check failed",true,500);
282
+ exit('md5 mismatch');
283
+ }
284
+
285
+ // Callback from Quickpay - just respond ok
286
+ echo "OK";
287
+ exit();
288
+ }
289
+ }
app/code/local/Quickpay/Payment/etc/config.xml ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Quickpay_Payment>
5
+ <version>3.1.0</version>
6
+ <depends>
7
+ <Mage_Paygate />
8
+ </depends>
9
+ </Quickpay_Payment>
10
+ </modules>
11
+ <global>
12
+ <blocks>
13
+ <quickpaypayment><class>Quickpay_Payment_Block</class></quickpaypayment>
14
+ </blocks>
15
+
16
+ <models>
17
+ <quickpaypayment>
18
+ <class>Quickpay_Payment_Model</class>
19
+ <resourceModel>quickpaypayment_mysql4</resourceModel>
20
+ </quickpaypayment>
21
+ <quickpaypayment_mysql4>
22
+ <class>Quickpay_Payment_Model_Mysql4</class>
23
+ <entities>
24
+ <api_debug><table>Quickpay_api_debug</table></api_debug>
25
+ </entities>
26
+ </quickpaypayment_mysql4>
27
+ </models>
28
+ <helpers>
29
+ <quickpaypayment>
30
+ <class>Quickpay_Payment_Helper</class>
31
+ </quickpaypayment>
32
+ </helpers>
33
+
34
+ <events>
35
+ <sales_order_payment_capture>
36
+ <observers>
37
+ <module>
38
+ <type>singleton</type>
39
+ <class>Quickpay_Payment_Model_Observer</class>
40
+ <method>capture</method>
41
+ </module>
42
+ </observers>
43
+ </sales_order_payment_capture>
44
+ <sales_order_creditmemo_refund>
45
+ <observers>
46
+ <module>
47
+ <type>singleton</type>
48
+ <class>Quickpay_Payment_Model_Observer</class>
49
+ <method>refund</method>
50
+ </module>
51
+ </observers>
52
+ </sales_order_creditmemo_refund>
53
+ <!--
54
+ <order_cancel_after>
55
+ <observers>
56
+ <module>
57
+ <type>singleton</type>
58
+ <class>Quickpay_Payment_Model_Observer</class>
59
+ <method>cancel</method>
60
+ </module>
61
+ </observers>
62
+ </order_cancel_after>
63
+ -->
64
+ </events>
65
+
66
+
67
+
68
+
69
+ <resources>
70
+ <quickpaypayment_setup>
71
+ <setup>
72
+ <module>Quickpay_Payment</module>
73
+ <class>Quickpay_Payment_Model_Mysql4_Setup</class>
74
+ </setup>
75
+ <connection>
76
+ <use>core_setup</use>
77
+ </connection>
78
+ </quickpaypayment_setup>
79
+ <quickpaypayment_write>
80
+ <connection>
81
+ <use>core_write</use>
82
+ </connection>
83
+ </quickpaypayment_write>
84
+ <quickpaypayment_read>
85
+ <connection>
86
+ <use>core_read</use>
87
+ </connection>
88
+ </quickpaypayment_read>
89
+ </resources>
90
+
91
+ </global>
92
+ <frontend>
93
+ <secure_url>
94
+ <quickpaypayment_payment>/quickpaypayment/payment</quickpaypayment_payment>
95
+ </secure_url>
96
+ <routers>
97
+ <quickpaypayment>
98
+ <use>standard</use>
99
+ <args>
100
+ <module>Quickpay_Payment</module>
101
+ <frontName>quickpaypayment</frontName>
102
+ </args>
103
+ </quickpaypayment>
104
+ </routers>
105
+ <translate>
106
+ <modules>
107
+ <Quickpay_Payment>
108
+ <files>
109
+ <default>Quickpay_Payment.csv</default>
110
+ </files>
111
+ </Quickpay_Payment>
112
+ </modules>
113
+ </translate>
114
+ <layout>
115
+ <updates>
116
+ <quickpaypayment_payment>
117
+ <file>Quickpay_Payment.xml</file>
118
+ </quickpaypayment_payment>
119
+ </updates>
120
+ </layout>
121
+ </frontend>
122
+ <adminhtml>
123
+ <translate>
124
+ <modules>
125
+ <Quickpay_Payment>
126
+ <files>
127
+ <default>Quickpay_Payment.csv</default>
128
+ </files>
129
+ </Quickpay_Payment>
130
+ </modules>
131
+ </translate>
132
+ <acl>
133
+ <resources>
134
+ <admin>
135
+ <children>
136
+ <system>
137
+ <children>
138
+ <config>
139
+ <children>
140
+ <quickpaypayment>
141
+ <title>Quickpay Section</title>
142
+ </quickpaypayment>
143
+ </children>
144
+ </config>
145
+ </children>
146
+ </system>
147
+ </children>
148
+ </admin>
149
+ </resources>
150
+ </acl>
151
+ </adminhtml>
152
+
153
+ <default>
154
+ <payment>
155
+ <quickpaypayment_payment>
156
+ <model>quickpaypayment/payment</model>
157
+ <title>Quickpay Kortbetaling</title>
158
+ <active>1</active>
159
+ <sort_order>1</sort_order>
160
+ <merchantnumber>ENTER YOUR MERCHANTNUMBER HERE</merchantnumber>
161
+ <cardtype>0</cardtype>
162
+ <sendmailorderconfirmation>1</sendmailorderconfirmation>
163
+ <trustedlogos>verisign_secure,mastercard_securecode,pci,nets</trustedlogos>
164
+ <cardlogos>dankort,edankort,danskenetbetaling,nordea,ewire,forbrugsforeningen,visa,visaelectron,mastercard,maestro,jcb,diners,amex</cardlogos>
165
+ <handlestock>1</handlestock>
166
+ <allowspecific>0</allowspecific>
167
+ <transaction_type>O</transaction_type>
168
+ <post_url>https://secure.quickpay.dk/form/</post_url>
169
+ <instantcapture>0</instantcapture>
170
+ <instantinvoice>0</instantinvoice>
171
+ <transactionfee>0</transactionfee>
172
+ <specifytransactionfee>0</specifytransactionfee>
173
+ </quickpaypayment_payment>
174
+ </payment>
175
+
176
+ <web>
177
+ <session>
178
+ <use_remote_addr>0</use_remote_addr>
179
+ </session>
180
+ </web>
181
+ </default>
182
+
183
+ <interest_form>
184
+ <label>lead capture form</label>
185
+ <template>page/leadcapture.phtml</template>
186
+ </interest_form>
187
+
188
+ </config>
app/code/local/Quickpay/Payment/etc/system.xml ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <quickpaypayment_payment translate="label" module="quickpaypayment">
7
+ <label>Quickpay Payment</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>1</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>0</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Aktiv</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>0</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Titel</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>10</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>0</show_in_store>
30
+ </title>
31
+ <merchantnumber translate="label">
32
+ <label>Quickpay Id</label>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>11</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>0</show_in_store>
38
+ </merchantnumber>
39
+ <md5secret translate="label">
40
+ <label>MD5 Secret</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>15</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>0</show_in_store>
46
+ </md5secret>
47
+ <order_status_before_payment translate="label">
48
+ <label>Ny ordre status (Før betaling er gennemført)</label>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>adminhtml/system_config_source_order_status</source_model>
51
+ <sort_order>20</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>0</show_in_store>
55
+ </order_status_before_payment>
56
+ <order_status translate="label">
57
+ <label>Ny ordre status (Efter betaling er gennemført)</label>
58
+ <frontend_type>select</frontend_type>
59
+ <source_model>adminhtml/system_config_source_order_status</source_model>
60
+ <sort_order>21</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>0</show_in_store>
64
+ </order_status>
65
+ <allowspecific translate="label">
66
+ <label>Betaling fra gældende lande</label>
67
+ <frontend_type>allowspecific</frontend_type>
68
+ <sort_order>30</sort_order>
69
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ </allowspecific>
74
+ <specificcountry translate="label">
75
+ <label>Payment from Specific countries</label>
76
+ <frontend_type>multiselect</frontend_type>
77
+ <sort_order>31</sort_order>
78
+ <source_model>adminhtml/system_config_source_country</source_model>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>0</show_in_store>
82
+ </specificcountry>
83
+
84
+ <cardtype translate="label">
85
+ <label>Vælg mulige betalingsmetoder</label>
86
+ <frontend_type>select</frontend_type>
87
+ <source_model>quickpaypayment/system_config_source_cardtype</source_model>
88
+ <sort_order>40</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>0</show_in_store>
92
+ </cardtype>
93
+ <specifikcardtypes translate="label">
94
+ <label>Vælg specifikke betalingsmetoder</label>
95
+ <frontend_type>multiselect</frontend_type>
96
+ <source_model>quickpaypayment/system_config_source_specificcardtypes</source_model>
97
+ <sort_order>42</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>0</show_in_store>
101
+ </specifikcardtypes>
102
+ <use3dsecure translate="label">
103
+ <label>Benyt 3D-Secure</label>
104
+ <frontend_type>select</frontend_type>
105
+ <source_model>adminhtml/system_config_source_yesno</source_model>
106
+ <sort_order>45</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>1</show_in_website>
109
+ <show_in_store>0</show_in_store>
110
+ </use3dsecure>
111
+
112
+
113
+ <trustedlogos translate="label">
114
+ <label>Hvilke logoer skal vises</label>
115
+ <frontend_type>multiselect</frontend_type>
116
+ <source_model>quickpaypayment/system_config_source_trustedlogos</source_model>
117
+ <sort_order>80</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>1</show_in_website>
120
+ <show_in_store>0</show_in_store>
121
+ </trustedlogos>
122
+
123
+ <cardlogos translate="label">
124
+ <label>Hvilke kortlogoer skal vises</label>
125
+ <frontend_type>multiselect</frontend_type>
126
+ <source_model>quickpaypayment/system_config_source_cardlogos</source_model>
127
+ <sort_order>82</sort_order>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>1</show_in_website>
130
+ <show_in_store>0</show_in_store>
131
+ </cardlogos>
132
+
133
+ <!--
134
+ <post_url translate="label">
135
+ <label>Post URL</label>
136
+ <frontend_type>text</frontend_type>
137
+ <sort_order>16</sort_order>
138
+ <show_in_default>1</show_in_default>
139
+ <show_in_website>1</show_in_website>
140
+ <show_in_store>0</show_in_store>
141
+ </post_url>
142
+ -->
143
+
144
+ <instantcapture translate="label">
145
+ <label>Øjeblikkelig Hævning</label>
146
+ <frontend_type>select</frontend_type>
147
+ <source_model>adminhtml/system_config_source_yesno</source_model>
148
+ <sort_order>70</sort_order>
149
+ <show_in_default>1</show_in_default>
150
+ <show_in_website>1</show_in_website>
151
+ <show_in_store>0</show_in_store>
152
+ </instantcapture>
153
+
154
+ <instantinvoice translate="label">
155
+ <label>Øjeblikkelig fakturering</label>
156
+ <comment>Opret faktura automatisk, hvis hævning sker øjeblikkeligt.</comment>
157
+ <frontend_type>select</frontend_type>
158
+ <source_model>adminhtml/system_config_source_yesno</source_model>
159
+ <sort_order>72</sort_order>
160
+ <show_in_default>1</show_in_default>
161
+ <show_in_website>1</show_in_website>
162
+ <show_in_store>0</show_in_store>
163
+ </instantinvoice>
164
+
165
+
166
+
167
+
168
+ <sendmailorderconfirmation translate="label">
169
+ <label>Send e-mail Ordrebekræftelse. Aktivering af denne indstilling vil resultere i en email-bekræftelse sendes når betalingen er foretaget.</label>
170
+ <frontend_type>select</frontend_type>
171
+ <source_model>adminhtml/system_config_source_yesno</source_model>
172
+ <sort_order>80</sort_order>
173
+ <show_in_default>1</show_in_default>
174
+ <show_in_website>1</show_in_website>
175
+ <show_in_store>0</show_in_store>
176
+ </sendmailorderconfirmation>
177
+
178
+ <handlestock translate="label">
179
+ <label>Håndtering af lager. Varene vil først trækkes fra lageret, når betalingen er gennemført.</label>
180
+ <comment>OBS! Annullering af ikke betalte ordre, vil give falske lagerantal, med mindre Magento Lagermuligheden 'Sæt produktets status til 'på lager' når en ordre annulleres' er sat til 'Nej'</comment>
181
+ <frontend_type>select</frontend_type>
182
+ <source_model>adminhtml/system_config_source_yesno</source_model>
183
+ <sort_order>90</sort_order>
184
+ <show_in_default>1</show_in_default>
185
+ <show_in_website>1</show_in_website>
186
+ <show_in_store>0</show_in_store>
187
+ </handlestock>
188
+
189
+ <transactionfee translate="label">
190
+ <label>Opkræv Transaktionsgebyr</label>
191
+ <comment>Skal også aktiveres hos Quickpay</comment>
192
+ <frontend_type>select</frontend_type>
193
+ <source_model>adminhtml/system_config_source_yesno</source_model>
194
+ <sort_order>100</sort_order>
195
+ <show_in_default>1</show_in_default>
196
+ <show_in_website>1</show_in_website>
197
+ <show_in_store>0</show_in_store>
198
+ </transactionfee>
199
+ <specifytransactionfee translate="label">
200
+ <label>Transaktionsgebyr Udspecificeret</label>
201
+ <comment>Udspecificeres kun hvis transaktionsgebyr er slået til</comment>
202
+ <frontend_type>select</frontend_type>
203
+ <source_model>adminhtml/system_config_source_yesno</source_model>
204
+ <sort_order>102</sort_order>
205
+ <show_in_default>1</show_in_default>
206
+ <show_in_website>1</show_in_website>
207
+ <show_in_store>0</show_in_store>
208
+ </specifytransactionfee>
209
+ <showtransactionsfees translate="label">
210
+ <label>Vis gebyrer for</label>
211
+ <comment>Vælg hvilke gebyrer der skal vises for kunden</comment>
212
+ <frontend_type>multiselect</frontend_type>
213
+ <source_model>quickpaypayment/system_config_source_transactionfees</source_model>
214
+ <sort_order>104</sort_order>
215
+ <show_in_default>1</show_in_default>
216
+ <show_in_website>1</show_in_website>
217
+ <show_in_store>0</show_in_store>
218
+ </showtransactionsfees>
219
+ <serviceuser translate="label">
220
+ <label>Bruger</label>
221
+ <frontend_type>text</frontend_type>
222
+ <comment>Bruger og kode til quickpay er kun nødvendigt, hvis der skal vises gebyrer for kunden. For egen sikkerhed - anbefales det at oprette en bruger helt uden rettigheder i Quickpay Manageren til dette formål</comment>
223
+ <sort_order>106</sort_order>
224
+ <show_in_default>1</show_in_default>
225
+ <show_in_website>1</show_in_website>
226
+ <show_in_store>0</show_in_store>
227
+ </serviceuser>
228
+ <servicepass translate="label">
229
+ <label>Kode</label>
230
+ <frontend_type>password</frontend_type>
231
+ <sort_order>108</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>0</show_in_store>
235
+ </servicepass>
236
+ <sort_order translate="label">
237
+ <label>Sorteringsrækkefølge</label>
238
+ <frontend_type>text</frontend_type>
239
+ <sort_order>1000</sort_order>
240
+ <show_in_default>1</show_in_default>
241
+ <show_in_website>1</show_in_website>
242
+ <show_in_store>0</show_in_store>
243
+ </sort_order>
244
+ </fields>
245
+ </quickpaypayment_payment>
246
+ </groups>
247
+ </payment>
248
+ </sections>
249
+ </config>
app/code/local/Quickpay/Payment/sql/quickpaypayment_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ /* @var $installer Quickpay_Payment_Model_Mysql4_Setup */
5
+
6
+ $installer->startSetup();
7
+
8
+ $installer->run("
9
+ CREATE TABLE IF NOT EXISTS {$installer->getTable('quickpaypayment_order_status')} (
10
+ id int(32) NOT NULL auto_increment,
11
+ status int(2) NOT NULL,
12
+ ordernum varchar(32) default NULL,
13
+ amount varchar(32) default NULL,
14
+ time varchar(20) default NULL,
15
+ pbsstat varchar(32) default NULL,
16
+ qpstat varchar(32) default NULL,
17
+ qpstatmsg varchar(60) default NULL,
18
+ chstat int(32) default NULL,
19
+ chstatmsg text,
20
+ merchantemail varchar(128) default NULL,
21
+ merchant varchar(128) default NULL,
22
+ currency varchar(10) default NULL,
23
+ cardtype varchar(32) default NULL,
24
+ transaction varchar(32) default NULL,
25
+ md5check varchar(128) default NULL,
26
+ capturedAmount varchar(32) DEFAULT NULL,
27
+ refundedAmount varchar(32) DEFAULT NULL,
28
+ splitpayment varchar(32) DEFAULT NULL,
29
+ fraudprobability varchar(254) DEFAULT NULL,
30
+ fraudremarks TEXT DEFAULT NULL,
31
+ fraudreport TEXT DEFAULT NULL,
32
+ fee varchar(32) DEFAULT NULL,
33
+ cardnumber varchar(32) DEFAULT NULL,
34
+ PRIMARY KEY (id),
35
+ KEY ordernum (ordernum)
36
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
37
+ ");
38
+
39
+
40
+ $installer->endSetup();
41
+
app/design/adminhtml/default/default/template/quickpaypayment/info/info.phtml ADDED
@@ -0,0 +1 @@
 
1
+ <p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
app/design/adminhtml/default/default/template/quickpaypayment/payment/form.phtml ADDED
File without changes
app/design/frontend/base/default/layout/Quickpay_Payment.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+ <quickpaypayment_redirect>
6
+ <reference name="content">
7
+ <block type="page/html" name="redirect" template="quickpaypayment/payment/redirect.phtml"></block>
8
+ </reference>
9
+ </quickpaypayment_redirect>
10
+
11
+ </layout>
app/design/frontend/base/default/template/quickpaypayment/info/default.phtml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
2
+ <?php echo $this->getQuickpayInfoHtml() ?>
app/design/frontend/base/default/template/quickpaypayment/info/payment_info.phtml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
2
+ <?php echo $this->getQuickpayInfoHtml() ?>
app/design/frontend/base/default/template/quickpaypayment/payment/form (Michael Gregersen's conflicted copy 2012-05-08).phtml ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $payment = Mage::getModel('quickpaypayment/payment');
3
+ ?>
4
+ <fieldset class="form-list">
5
+ <?php $_code=$this->getMethodCode() ?>
6
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
7
+ <li>
8
+ <?php echo $this->__('Du har valgt at betale for ordren online. Lige så snart du har gennemført din ordre, vil du blive overført til betalingssystemet. Her skal du gennemføre din betaling. Når betalingen er gennemført, vil du automatisk blive sendt tilbage til vores forretning.'); ?>
9
+
10
+
11
+
12
+ <?php if((int)$payment->getConfigData('transactionfee') == 1) : ?>
13
+
14
+ <?php //SHOW LIST OF SELECTED TRANSACTIONFEES IF ACTIVATED
15
+
16
+ $auth = base64_encode($payment->getConfigData('serviceuser').":".$payment->getConfigData('servicepass'));
17
+ $c = curl_init("https://api.quickpay.net/acquirers/nets/fees/".(int)($payment->getQuote()->getGrandTotal()*100));
18
+ curl_setopt($c,CURLOPT_RETURNTRANSFER, true);
19
+ curl_setopt($c,CURLOPT_HTTPHEADER, array('Authorization: Basic '.$auth,'X-QuickPay-Client-API-Version: 0.1'));
20
+
21
+
22
+ $fees = curl_exec($c);
23
+ curl_close($c);
24
+
25
+ $showfees = explode(",",$payment->getConfigData('showtransactionsfees'));
26
+
27
+
28
+ ?>
29
+ <?php if(count($showfees) && $fees !== false) : ?>
30
+ <br>
31
+ <br>
32
+ <b><?php echo $this->__("Tranaktionsgebyr"); ?></b>
33
+ <br>
34
+ <?php echo $this->__("Der vil blive opkrævet et transaktionsgebyr ved brug af denne betalingsmetode. Gebyr størrelsen afhænger af kortvalg og vil blive tilføjet ved betaling."); ?>
35
+ <table cellpadding="5px" cellspacing="5px">
36
+ <tr>
37
+ <th style="font-weight:bold;"><? echo $this->__("Cardtype") ?></th>
38
+ <th style="font-weight:bold; padding-left:10px;"><? echo $this->__("Fee") ?></th>
39
+ <th style="font-weight:bold; padding-left:10px; text-align:right;"><? echo $this->__("New Total") ?></th>
40
+ </tr>
41
+ <?php foreach($showfees as $showfee) : ?>
42
+ <?php foreach(json_decode($fees) as $type) : ?>
43
+ <?php if($type->lockname == $showfee) : ?>
44
+ <tr>
45
+ <td><? echo $this->__($type->lockname) ?></td>
46
+ <td style="font-weight:normal !important; margin-left:10px; padding-left:10px;" ><? echo str_replace(array('<span class="price">','</span>'),"",$this->helper('checkout')->formatPrice($type->fee/100)) ?></td>
47
+ <td style="font-weight:normal !important; margin-left:10px; padding-left:10px; text-align:right;"><? echo str_replace(array('<span class="price">','</span>'),"",$this->helper('checkout')->formatPrice($type->total/100)) ?></td>
48
+ </tr>
49
+ <?php endif; ?>
50
+ <?php endforeach; ?>
51
+ <?php endforeach; ?>
52
+ </table>
53
+ <?php endif; ?>
54
+ <?php endif; ?>
55
+
56
+
57
+ <?php if ($payment->showTrustedList()) : ?>
58
+ <br>
59
+ <br>
60
+ <?php $logoArray = explode(',', $payment->getConfigData('trustedlogos')); ?>
61
+
62
+ <?php foreach($logoArray as $item) : ?>
63
+ <?php
64
+ switch ($item)
65
+ {
66
+ case 'verisign_secure': {
67
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/verisign_secure.gif') ?>" border="0" />&nbsp;&nbsp;<?php
68
+ break;
69
+ }
70
+ case 'mastercard_securecode': {
71
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/mastercard_securecode.gif') ?>" border="0" />&nbsp;&nbsp;<?php
72
+ break;
73
+ }
74
+ case 'pci': {
75
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/pci.gif') ?>" border="0" />&nbsp;&nbsp;<?php
76
+ break;
77
+ }
78
+ case 'nets': {
79
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/nets.png') ?>" border="0" />&nbsp;&nbsp;<?php
80
+ break;
81
+ }
82
+ }
83
+ ?>
84
+ <?php endforeach; ?>
85
+ <?php endif; ?>
86
+ <?php
87
+ /*
88
+ * Hvis vi skal vælge kort type inden betaling!
89
+ * IMPLEMENTERING KOMMER HER
90
+ *
91
+ <input id="cardtypelock_creditcard" type="radio" name="cardtypelock" value="creditcard" selected="selected"/>
92
+ <label for="cardtypelock_creditcard">Creditcard</label><br/>
93
+ <input id="cardtypelock_danske-dk" type="radio" name="cardtypelock" value="danske-dk"/>
94
+ <label for="cardtypelock_danske-dk">Danske Netbank</label>
95
+ */
96
+ ?>
97
+ <?php if ($payment->showCardsList()) : ?>
98
+ <br>
99
+ <br>
100
+ <?php echo $this->__('Du kan betale med følgende betalingskort:') ?>
101
+ <br>
102
+ <?php $logoArray = explode(',', $payment->getConfigData('cardlogos')); ?>
103
+ <?php foreach($logoArray as $item) : ?>
104
+ <?php switch ($item) {
105
+ case 'dankort': {
106
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/dankort.gif') ?>" border="0" title="Dankort" />&nbsp;&nbsp;<?php
107
+ break;
108
+ }
109
+ case 'edankort': {
110
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/edankort.gif') ?>" border="0" title="eDankort" />&nbsp;&nbsp;<?php
111
+ break;
112
+ }
113
+ case 'danskenetbetaling': {
114
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/danskenetbetaling.gif') ?>" border="0" title="Danske Bank Netbetaling" />&nbsp;&nbsp;<?php
115
+ break;
116
+ }
117
+ case 'nordea': {
118
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/nordea.gif') ?>" border="0" title="Nordea e-betaling" />&nbsp;&nbsp;<?php
119
+ break;
120
+ }
121
+ case 'ewire': {
122
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/ewire.gif') ?>" border="0" title="EWIRE" />&nbsp;&nbsp;<?php
123
+ break;
124
+ }
125
+ case 'forbrugsforeningen': {
126
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/forbrugsforeningen.gif') ?>" border="0" title="Forbrugsforeningen" />&nbsp;&nbsp;<?php
127
+ break;
128
+ }
129
+ case 'visa': {
130
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/visa.gif') ?>" border="0" title="VISA" />&nbsp;&nbsp;<?php
131
+ break;
132
+ }
133
+ case 'visaelectron': {
134
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/visaelectron.gif') ?>" border="0" title="VISA Electron" />&nbsp;&nbsp;<?php
135
+ break;
136
+ }
137
+ case 'mastercard': {
138
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/mastercard.gif') ?>" border="0" title="MasterCard" />&nbsp;&nbsp;<?php
139
+ break;
140
+ }
141
+ case 'maestro': {
142
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/maestro.gif') ?>" border="0" title="Maestro" />&nbsp;&nbsp;<?php
143
+ break;
144
+ }
145
+ case 'jcb': {
146
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/jcb.gif') ?>" border="0" title="JCB" />&nbsp;&nbsp;<?php
147
+ break;
148
+ }
149
+ case 'diners': {
150
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/diners.gif') ?>" border="0" title="Diners Club" />&nbsp;&nbsp;<?php
151
+ break;
152
+ }
153
+ case 'amex': {
154
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/amex.gif') ?>" border="0" title="AMEX" />&nbsp;&nbsp;<?php
155
+ break;
156
+ }
157
+ }
158
+ ?>
159
+ <?php endforeach; ?>
160
+ <?php endif; ?>
161
+ </li>
162
+ </ul>
163
+ </fieldset>
app/design/frontend/base/default/template/quickpaypayment/payment/form.phtml ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $payment = Mage::getModel('quickpaypayment/payment');
3
+ ?>
4
+ <fieldset class="form-list">
5
+ <?php $_code=$this->getMethodCode() ?>
6
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
7
+ <li>
8
+ <?php echo Mage::helper('quickpaypayment')->__('Du har valgt at betale for ordren online. Lige så snart du har gennemført din ordre, vil du blive overført til betalingssystemet. Her skal du gennemføre din betaling. Når betalingen er gennemført, vil du automatisk blive sendt tilbage til vores forretning.'); ?>
9
+
10
+
11
+
12
+ <?php if((int)$payment->getConfigData('transactionfee') == 1) : ?>
13
+
14
+ <?php //SHOW LIST OF SELECTED TRANSACTIONFEES IF ACTIVATED
15
+
16
+ $auth = base64_encode($payment->getConfigData('serviceuser').":".$payment->getConfigData('servicepass'));
17
+ $c = curl_init("https://api.quickpay.net/acquirers/nets/fees/".(int)($payment->getQuote()->getGrandTotal()*100));
18
+ curl_setopt($c,CURLOPT_HTTPHEADER, array('Authorization: Basic '.$auth,'X-QuickPay-Client-API-Version: 0.1'));
19
+ curl_setopt($c,CURLOPT_RETURNTRANSFER, true);
20
+ curl_setopt($c,CURLOPT_SSL_VERIFYPEER, false);
21
+
22
+ $fees = curl_exec($c);
23
+ curl_close($c);
24
+
25
+ $showfees = explode(",",$payment->getConfigData('showtransactionsfees'));
26
+ ?>
27
+
28
+ <?php if(count($showfees) && $fees !== false) : ?>
29
+ <br>
30
+ <br>
31
+ <b><?php echo Mage::helper('quickpaypayment')->__("Tranaktionsgebyr"); ?></b>
32
+ <br>
33
+ <?php echo Mage::helper('quickpaypayment')->__("Der vil blive opkrævet et transaktionsgebyr ved brug af denne betalingsmetode. Gebyr størrelsen afhænger af kortvalg og vil blive tilføjet ved betaling."); ?>
34
+ <table cellpadding="5px" cellspacing="5px">
35
+ <tr>
36
+ <th style="font-weight:bold;"><? echo Mage::helper('quickpaypayment')->__("Korttype") ?></th>
37
+ <th style="font-weight:bold; padding-left:10px;"><? echo Mage::helper('quickpaypayment')->__("Gebyr") ?></th>
38
+ <th style="font-weight:bold; padding-left:10px; text-align:right;"><? echo Mage::helper('quickpaypayment')->__("Ny Total") ?></th>
39
+ </tr>
40
+ <?php foreach($showfees as $showfee) : ?>
41
+ <?php foreach(json_decode($fees) as $type) : ?>
42
+ <?php if($type->lockname == $showfee) : ?>
43
+ <tr>
44
+ <td><? echo Mage::helper('quickpaypayment')->__($type->lockname) ?></td>
45
+ <td style="font-weight:normal !important; margin-left:10px; padding-left:10px;" ><? echo str_replace(array('<span class="price">','</span>'),"",$this->helper('checkout')->formatPrice($type->fee/100)) ?></td>
46
+ <td style="font-weight:normal !important; margin-left:10px; padding-left:10px; text-align:right;"><? echo str_replace(array('<span class="price">','</span>'),"",$this->helper('checkout')->formatPrice($type->total/100)) ?></td>
47
+ </tr>
48
+ <?php endif; ?>
49
+ <?php endforeach; ?>
50
+ <?php endforeach; ?>
51
+ </table>
52
+ <?php endif; ?>
53
+ <?php endif; ?>
54
+
55
+
56
+ <?php if ($payment->showTrustedList()) : ?>
57
+ <br>
58
+ <br>
59
+ <?php $logoArray = explode(',', $payment->getConfigData('trustedlogos')); ?>
60
+
61
+ <?php foreach($logoArray as $item) : ?>
62
+ <?php
63
+ switch ($item)
64
+ {
65
+ case 'verisign_secure': {
66
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/verisign_secure.gif') ?>" border="0" />&nbsp;&nbsp;<?php
67
+ break;
68
+ }
69
+ case 'mastercard_securecode': {
70
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/mastercard_securecode.gif') ?>" border="0" />&nbsp;&nbsp;<?php
71
+ break;
72
+ }
73
+ case 'pci': {
74
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/pci.gif') ?>" border="0" />&nbsp;&nbsp;<?php
75
+ break;
76
+ }
77
+ case 'nets': {
78
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/nets.png') ?>" border="0" />&nbsp;&nbsp;<?php
79
+ break;
80
+ }
81
+ case 'euroline': {
82
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/euroline.gif') ?>" border="0" />&nbsp;&nbsp;<?php
83
+ break;
84
+ }
85
+ }
86
+ ?>
87
+ <?php endforeach; ?>
88
+ <?php endif; ?>
89
+ <?php
90
+ /*
91
+ * Hvis vi skal vælge kort type inden betaling!
92
+ * IMPLEMENTERING KOMMER HER
93
+ *
94
+ <input id="cardtypelock_creditcard" type="radio" name="cardtypelock" value="creditcard" selected="selected"/>
95
+ <label for="cardtypelock_creditcard">Creditcard</label><br/>
96
+ <input id="cardtypelock_danske-dk" type="radio" name="cardtypelock" value="danske-dk"/>
97
+ <label for="cardtypelock_danske-dk">Danske Netbank</label>
98
+ */
99
+ ?>
100
+ <?php if ($payment->showCardsList()) : ?>
101
+ <br>
102
+ <br>
103
+ <?php echo Mage::helper('quickpaypayment')->__('Du kan betale med følgende betalingsmetoder:') ?>
104
+ <br>
105
+ <?php $logoArray = explode(',', $payment->getConfigData('cardlogos')); ?>
106
+ <?php foreach($logoArray as $item) : ?>
107
+ <?php switch ($item) {
108
+ case 'dankort': {
109
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/dankort.gif') ?>" border="0" title="Dankort" />&nbsp;&nbsp;<?php
110
+ break;
111
+ }
112
+ case 'edankort': {
113
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/edankort.gif') ?>" border="0" title="eDankort" />&nbsp;&nbsp;<?php
114
+ break;
115
+ }
116
+ case 'danskenetbetaling': {
117
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/danskenetbetaling.gif') ?>" border="0" title="Danske Bank Netbetaling" />&nbsp;&nbsp;<?php
118
+ break;
119
+ }
120
+ case 'nordea': {
121
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/nordea.gif') ?>" border="0" title="Nordea e-betaling" />&nbsp;&nbsp;<?php
122
+ break;
123
+ }
124
+ case 'ewire': {
125
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/ewire.gif') ?>" border="0" title="EWIRE" />&nbsp;&nbsp;<?php
126
+ break;
127
+ }
128
+ case 'forbrugsforeningen': {
129
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/forbrugsforeningen.gif') ?>" border="0" title="Forbrugsforeningen" />&nbsp;&nbsp;<?php
130
+ break;
131
+ }
132
+ case 'visa': {
133
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/visa.gif') ?>" border="0" title="VISA" />&nbsp;&nbsp;<?php
134
+ break;
135
+ }
136
+ case 'visaelectron': {
137
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/visaelectron.gif') ?>" border="0" title="VISA Electron" />&nbsp;&nbsp;<?php
138
+ break;
139
+ }
140
+ case 'mastercard': {
141
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/mastercard.gif') ?>" border="0" title="MasterCard" />&nbsp;&nbsp;<?php
142
+ break;
143
+ }
144
+ case 'maestro': {
145
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/maestro.gif') ?>" border="0" title="Maestro" />&nbsp;&nbsp;<?php
146
+ break;
147
+ }
148
+ case 'jcb': {
149
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/jcb.gif') ?>" border="0" title="JCB" />&nbsp;&nbsp;<?php
150
+ break;
151
+ }
152
+ case 'diners': {
153
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/diners.gif') ?>" border="0" title="Diners Club" />&nbsp;&nbsp;<?php
154
+ break;
155
+ }
156
+ case 'amex': {
157
+ ?><img src="<?php echo $this->getSkinUrl('images/quickpaypayment/amex.gif') ?>" border="0" title="AMEX" />&nbsp;&nbsp;<?php
158
+ break;
159
+ }
160
+ }
161
+ ?>
162
+ <?php endforeach; ?>
163
+ <?php endif; ?>
164
+ </li>
165
+ </ul>
166
+ </fieldset>
app/design/frontend/base/default/template/quickpaypayment/payment/info/payment_info.phtml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <p><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></p>
2
+ <?php print_r($this->paymentData) ?>
app/design/frontend/base/default/template/quickpaypayment/payment/redirect/paymentwindow.phtml ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $payment = Mage::getModel('quickpaypayment/payment');
4
+
5
+ $order = Mage::getModel('sales/order');
6
+ $order->loadByIncrementId($payment->getCheckout()->getLastRealOrderId());
7
+
8
+
9
+ // CACHE BLOCK HTML OUTPUT DISABLE HACK --> START
10
+ $success = explode("?", Mage::getUrl('quickpaypayment/payment/success')); // Removes wierd cache url attachment ?SID_U
11
+ $redirect = explode("?",Mage::getUrl('quickpaypayment/payment/cancel')); // Removes wierd cache url attachment ?SID_U
12
+ $callback = explode("?",Mage::getUrl('quickpaypayment/payment/callback')); // Removes wierd cache url attachment ?SID_U
13
+ // CACHE BLOCK HTML OUTPUT DISABLE HACK --> END
14
+
15
+
16
+ //3D secure kort.
17
+ $secure3DCards = array('creditcard',
18
+ 'jcb',
19
+ 'maestro',
20
+ 'maestro-dk',
21
+ 'mastercard',
22
+ 'mastercard-dk',
23
+ 'mastercard-debet-dk',
24
+ 'visa',
25
+ 'visa-dk',
26
+ 'visa-electron',
27
+ 'visa-electron-dk',
28
+ );
29
+ $use3dSecure = ($payment->getConfigData('use3dsecure') == 1) ? true : false;
30
+
31
+ $cardlocktype = "";
32
+
33
+ if($payment->getConfigData('cardtype') == 'specific-cards')
34
+ {
35
+ $specificcards = explode(",",$payment->getConfigData('specifikcardtypes'));
36
+ foreach($specificcards as $card)
37
+ {
38
+ if($use3dSecure && in_array($card,$secure3DCards))
39
+ {
40
+ $cardlocktype .= "3d-".$card;
41
+ }
42
+ else
43
+ {
44
+ $cardlocktype .= $card;
45
+ }
46
+ $cardlocktype .= ",";
47
+ }
48
+ }
49
+ elseif($payment->getConfigData('cardtype') == 'creditcard')
50
+ {
51
+ if($use3dSecure)
52
+ {
53
+ $cardlocktype .= "3d-creditcard";
54
+ }
55
+ else
56
+ {
57
+ $cardlocktype .= 'creditcard';
58
+ }
59
+ }
60
+ $cardlocktype = rtrim($cardlocktype,",");
61
+
62
+ $md5string = 4 .
63
+ 'authorize' .
64
+ $payment->getConfigData("merchantnumber") .
65
+ $payment->calcLanguage(Mage::app()->getLocale()->getLocaleCode()) .
66
+ $payment->getCheckout()->getLastRealOrderId() .
67
+ ($order->getTotalDue() * 100) .
68
+ $order->getOrderCurrency()->ToString() .
69
+ $success[0] .
70
+ $redirect[0] .
71
+ $callback[0] .
72
+ $payment->getConfigData('instantcapture') .
73
+ $cardlocktype .
74
+ $payment->getConfigData("md5secret");
75
+
76
+
77
+ ?>
78
+
79
+ <form id="quickpaypayment" action="<?php echo $payment->getConfigData('post_url'); ?>" method="post">
80
+
81
+
82
+ <input type="hidden" name="merchant" value="<?php echo $payment->getConfigData("merchantnumber") ?>">
83
+ <input type="hidden" name="continueurl" value="<?php echo Mage::getUrl('quickpaypayment/payment/success') ?>">
84
+ <input type="hidden" name="cancelurl" value="<?php echo Mage::getUrl('quickpaypayment/payment/cancel') ?>">
85
+ <input type="hidden" name="callbackurl" value="<?php echo Mage::getUrl('quickpaypayment/payment/callback') ?>">
86
+ <input type="hidden" name="ordernumber" value="<?php echo $payment->getCheckout()->getLastRealOrderId() ?>">
87
+ <input type="hidden" name="autocapture" value="<?php echo $payment->getConfigData('instantcapture') ?>">
88
+ <input type="hidden" name="cardtypelock" value="<?php echo $cardlocktype; ?>">
89
+ <input type="hidden" name="msgtype" value="authorize">
90
+ <input type="hidden" name="protocol" value="4">
91
+ <input type="hidden" name="amount" value="<?php echo $order->getTotalDue() * 100 ?>">
92
+ <input type="hidden" name="md5check" value="<?php echo md5($md5string) ?>">
93
+ <input type="hidden" name="currency" value="<?php echo $order->getOrderCurrency()->ToString() ?>">
94
+ <input type="hidden" name="language" value="<?php echo $payment->calcLanguage(Mage::app()->getLocale()->getLocaleCode()) ?>">
95
+
96
+
97
+ </form>
98
+
99
+ <script type="text/JavaScript">
100
+ document.getElementById('quickpaypayment').submit();
101
+ </script>
102
+
103
+ <?php exit(); ?>
app/etc/modules/Quickpay_Payment.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Quickpay_Payment>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Quickpay_Payment>
8
+ </modules>
9
+ </config>
app/locale/da_DK/Quickpay_Payment.csv ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Betalings objektet kan ikke hente information","Betalings objektet kan ikke hente information"
2
+ "Transaktions ID:","Transaktions ID:"
3
+ "Korttype:","Korttype:"
4
+ "Valuta:","Valuta:"
5
+ "Der er endnu ikke registreret nogen betaling for denne ordre!","Der er endnu ikke registreret nogen betaling for denne ordre!"
6
+ "inkl. %s %s i transaktionsgebyr","inkl. %s %s i transaktionsgebyr"
7
+ "Tomt svar modtaget fra Quickpay API","Tomt svar modtaget fra Quickpay API"
8
+ "Ingen svar modtaget fra Quickpay API","Ingen svar modtaget fra Quickpay API"
9
+ "Betalingen er hævet online","Betalingen er hævet online"
10
+ "Der forsøges at hæve et højere beløb en tilladt","Der forsøges at hæve et højere beløb en tilladt"
11
+ "Kreditnota refunderet online","Kreditnota refunderet online"
12
+ "Max beløb der kan refunderes: %s","Max beløb der kan refunderes: %s"
13
+ "Kreditnota refunderede % online","Kreditnota refunderede % online"
14
+ "Betalingen blev annulleret online","Betalingen blev annulleret online"
15
+ "Ikke en Quickpay Betaling","Ikke en Quickpay Betaling"
16
+ "Ikke muligt at hæve betalingen online, grundet denne fejl: %s","Ikke muligt at hæve betalingen online, grundet denne fejl: %s"
17
+ "Ikke muligt at refundere betalingen online, grundet denne fejl: %s","Ikke muligt at refundere betalingen online, grundet denne fejl: %s"
18
+ "Ikke muligt at annullerer betalingen online, grundet denne fejl: %s","Ikke muligt at annullerer betalingen online, grundet denne fejl: %s"
19
+ "Valutakoden (%s) er ikke kompatible med Quickpay","Valutakoden (%s) er ikke kompatible med Quickpay"
20
+ "Maks beløb:","Maks beløb:"
21
+ "Alle betalingsmetoder","Alle betalingsmetoder"
22
+ "Alle kreditkort","Alle kreditkort"
23
+ "Vælg specifikke betalingsmetoder","Vælg specifikke betalingsmetoder"
24
+
25
+ "American Express","American Express"
26
+ "American Express (udstedt i Danmark)","American Express (udstedt i Danmark)"
27
+ "Dankort","Dankort"
28
+ "Danske Net Bank","Danske Net Bank"
29
+ "Diners Club","Diners Club"
30
+ "Diners Club (udstedt i Danmark)","Diners Club (udstedt i Danmark)"
31
+ "eDankort","eDankort"
32
+ "Forbrugsforeningen af 1886","Forbrugsforeningen af 1886"
33
+ "JCB","JCB"
34
+ "Mastercard","Mastercard"
35
+ "Mastercard (udstedt i Danmark)","Mastercard (udstedt i Danmark)"
36
+ "Mastercard debit (udstedt i Danmark)","Mastercard debit (udstedt i Danmark)"
37
+ "Nordea Net Bank","Nordea Net Bank"
38
+ "Visa","Visa"
39
+ "Visa (udstedt i Danmark)","Visa (udstedt i Danmark)"
40
+ "Visa Electron","Visa Electron"
41
+ "Visa Electron (udstedt i Danmark)","Visa Electron (udstedt i Danmark)"
42
+ "PayPal","PayPal"
43
+ "American Express (Dansk)","American Express (Dansk)"
44
+ "Dankort","Dankort"
45
+ "Diners (Dansk)","Diners (Dansk)"
46
+ "edankort","edankort"
47
+ "Maestro (Dansk)","Maestro (Dansk)"
48
+ "Mastercard (Dansk)","Mastercard (Dansk)"
49
+ "Mastercard debit (Danish)","Mastercard debit (Danish)"
50
+ "Visa (Dansk)","Visa (Dansk)"
51
+ "Visa Electron (Dansk)","Visa Electron (Dansk)"
52
+ "Forbrugsforeningen","Forbrugsforeningen"
53
+ "American Express","American Express"
54
+ "Diners","Diners"
55
+ "JCB","JCB"
56
+ "Maestro","Maestro"
57
+ "Mastercard","Mastercard"
58
+ "Visa","Visa"
59
+ "Visa Electron","Visa Electron"
60
+ "Du har valgt at betale for ordren online. Lige så snart du har gennemført din ordre, vil du blive overført til betalingssystemet. Her skal du gennemføre din betaling. Når betalingen er gennemført, vil du automatisk blive sendt tilbage til vores forretning.","Du har valgt at betale for ordren online. Lige så snart du har gennemført din ordre, vil du blive overført til betalingssystemet. Her skal du gennemføre din betaling. Når betalingen er gennemført, vil du automatisk blive sendt tilbage til vores forretning."
61
+ "Tranaktionsgebyr","Tranaktionsgebyr"
62
+ "Der vil blive opkrævet et transaktionsgebyr ved brug af denne betalingsmetode. Gebyr størrelsen afhænger af kortvalg og vil blive tilføjet ved betaling.","Der vil blive opkrævet et transaktionsgebyr ved brug af denne betalingsmetode. Gebyr størrelsen afhænger af kortvalg og vil blive tilføjet ved betaling."
63
+ "Korttype","Korttype"
64
+ "Gebyr","Gebyr"
65
+ "Ny Total","Ny Total"
66
+ "Du kan betale med følgende betalingsmetoder:","Du kan betale med følgende betalingsmetoder:"
67
+ "Aktiv","Aktiv"
68
+ "Titel","Titel"
69
+ "Quickpay Id","Quickpay Id"
70
+ "MD5 Secret","MD5 Secret"
71
+ "Ny ordre status (Før betaling er gennemført)","Ny ordre status (Før betaling er gennemført)"
72
+ "Ny ordre status (Efter betaling er gennemført)","Ny ordre status (Efter betaling er gennemført)"
73
+ "Betaling fra gældende lande","Betaling fra gældende lande"
74
+ "Betaling fra specifikke lande","Betaling fra specifikke lande"
75
+ "Vælg mulige betalingsmetoder","Vælg mulige betalingsmetoder"
76
+ "Vælg specifikke betalingsmetoder","Vælg specifikke betalingsmetoder"
77
+ "Benyt 3D-Secure","Benyt 3D-Secure"
78
+ "Hvilke logoer skal vises","Hvilke logoer skal vises"
79
+ "Hvilke kortlogoer skal vises","Hvilke kortlogoer skal vises"
80
+ "Øjeblikkelig Hævning","Øjeblikkelig Hævning"
81
+ "Øjeblikkelig fakturering","Øjeblikkelig fakturering"
82
+ "Opret faktura automatisk, hvis hævning sker øjeblikkeligt.","Opret faktura automatisk, hvis hævning sker øjeblikkeligt."
83
+ "Send e-mail Ordrebekræftelse. Aktivering af denne indstilling vil resultere i en email-bekræftelse sendes når betalingen er foretaget.","Send e-mail Ordrebekræftelse. Aktivering af denne indstilling vil resultere i en email-bekræftelse sendes når betalingen er foretaget."
84
+ "Håndtering af lager. Varene vil først trækkes fra lageret, når betalingen er gennemført.","Håndtering af lager. Varene vil først trækkes fra lageret, når betalingen er gennemført."
85
+ "OBS! Annullering af ikke betalte ordre, vil give falske lagerantal, med mindre Magento Lagermuligheden 'Sæt produktets status til 'på lager' når en ordre annulleres' er sat til 'Nej'","OBS! Annullering af ikke betalte ordre, vil give falske lagerantal, med mindre Magento Lagermuligheden 'Sæt produktets status til 'på lager' når en ordre annulleres' er sat til 'Nej'"
86
+ "Opkræv Transaktionsgebyr","Opkræv Transaktionsgebyr"
87
+ "Skal også aktiveres hos Quickpay","Skal også aktiveres hos Quickpay"
88
+ "Transaktionsgebyr Udspecificeret","Transaktionsgebyr Udspecificeret"
89
+ "Udspecificeres kun hvis transaktionsgebyr er slået til","Udspecificeres kun hvis transaktionsgebyr er slået til"
90
+ "Vis gebyrer for","Vis gebyrer for"
91
+ "Vælg hvilke gebyrer der skal vises for kunden","Vælg hvilke gebyrer der skal vises for kunden"
92
+ "Bruger","Bruger"
93
+ "Bruger og kode til quickpay er kun nødvendigt, hvis der skal vises gebyrer for kunden. For egen sikkerhed - anbefales det at oprette en bruger helt uden rettigheder i Quickpay Manageren til dette formål","Bruger og kode til quickpay er kun nødvendigt, hvis der skal vises gebyrer for kunden. For egen sikkerhed - anbefales det at oprette en bruger helt uden rettigheder i Quickpay Manageren til dette formål"
94
+ "Kode","Kode"
95
+ "Sorteringsrækkefølge","Sorteringsrækkefølger"
app/locale/en_US/Quickpay_Payment.csv ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Betalings objektet kan ikke hente information",""
2
+ "Transaktions ID:",""
3
+ "Korttype:",""
4
+ "Valuta:",""
5
+ "Der er endnu ikke registreret nogen betaling for denne ordre!",""
6
+ "inkl. %s %s i transaktionsgebyr",""
7
+ "Tomt svar modtaget fra Quickpay API","Empty responce received from the Quickpay API"
8
+ "Ingen svar modtaget fra Quickpay API","No responce received from the Quickpay API"
9
+ "Betalingen er hævet online","The payment was successfully captured online"
10
+ "Der forsøges at hæve et højere beløb en tilladt","Your trying to capture to large an amount of money"
11
+ "Kreditnota refunderet online","The creditmemo was successfully refunded online"
12
+ "Maks beløb der kan refunderes: %s","Maximum amount available to refund: %s"
13
+ "Kreditnota refunderede % online","The creditmemo successfully refunded %s online"
14
+ "Betalingen blev annulleret online","The payment was successfully canceled online"
15
+ "Ikke en Quickpay Betaling","Not a Quickpay Payment"
16
+ "Ikke muligt at hæve betalingen online, grundet denne fejl: %s","Not able to capture your payment online, due to this error: %s"
17
+ "Ikke muligt at refundere betalingen online, grundet denne fejl: %s","Not able to refund your payment online, due to this error: %s"
18
+ "Ikke muligt at annullerer betalingen online, grundet denne fejl: %s","Not able to refund your payment online, due to this error: %s"
19
+ "Valutakoden (%s) er ikke kompatible med Quickpay","Selected currency code (%s) is not compatabile with Quickpay"
20
+ "Maks beløb:","Max amount:"
21
+ "Alle betalingsmetoder","All paymentoptions"
22
+ "Alle kreditkort","All Creditcards"
23
+ "Vælg specifikke betalingsmetoder","Choose Specific Paymentoptions"
24
+ "American Express","American Express credit card"
25
+ "American Express (udstedt i Danmark)","American Express credit card (issued in Denmark)"
26
+ "Dankort","Dankort credit card"
27
+ "Danske Net Bank","Danske Net Bank"
28
+ "Diners Club","Diners Club credit card"
29
+ "Diners Club (udstedt i Danmark)","Diners Club credit card (issued in Denmark)"
30
+ "eDankort","eDankort credit card"
31
+ "Forbrugsforeningen af 1886","Forbrugsforeningen af 1886"
32
+ "JCB","JCB credit card"
33
+ "Mastercard","Mastercard credit card"
34
+ "Mastercard (udstedt i Danmark)","Mastercard credit card (issued in Denmark)"
35
+ "Mastercard debit (udstedt i Danmark)","Mastercard debet card (issued in Denmark)"
36
+ "Nordea Net Bank","Nordea Net Bank"
37
+ "Visa","Visa credit card"
38
+ "Visa (udstedt i Danmark)","Visa credit card (issued in Denmark)"
39
+ "Visa Electron","Visa Electron credit card"
40
+ "Visa Electron (udstedt i Danmark)","Visa Electron credit card (issued in Denmark)"
41
+ "PayPal","PayPal"
42
+ "American Express (Dansk)","American Express (Danish)"
43
+ "Dankort","Dankort"
44
+ "Diners (Dansk)","Diners (Danish)"
45
+ "edankort","edankort"
46
+ "Maestro (Dansk)","Maestro (Danish)"
47
+ "Mastercard (Dansk)","Mastercard (Danish)"
48
+ "Mastercard debit (Danish)","Mastercard debet (Danish)"
49
+ "Visa (Dansk)","Visa (Danish)"
50
+ "Visa Electron (Danish)","Visa Electron (Danish)"
51
+ "Forbrugsforeningen","Forbrugsforeningen"
52
+ "American Express","American Express"
53
+ "Diners","Diners"
54
+ "JCB","JCB"
55
+ "Maestro","Maestro"
56
+ "Mastercard","Mastercard"
57
+ "Visa","Visa"
58
+ "Visa Electron","Visa Electron"
59
+ "Du har valgt at betale for ordren online. Lige så snart du har gennemført din ordre, vil du blive overført til betalingssystemet. Her skal du gennemføre din betaling. Når betalingen er gennemført, vil du automatisk blive sendt tilbage til vores forretning.","You have chosen to pay for the order online. Once you've completed your order, you will be transferred to the payment system. Here you need to process your payment. Once payment is completed, you will automatically be returned to our shop."
60
+ "Tranaktionsgebyr","Transactionfees"
61
+ "Der vil blive opkrævet et transaktionsgebyr ved brug af denne betalingsmetode. Gebyr størrelsen afhænger af kortvalg og vil blive tilføjet ved betaling.","A transaction fee will be charged with the use of this payment method. The fee amount depends on the card type used, and will added on payment."
62
+ "Korttype","Card type"
63
+ "Gebyr","Fee"
64
+ "Ny Total","New Total"
65
+ "Du kan betale med følgende betalingsmetoder:","Following payment types can be used:"
66
+ "Aktiv","Enabled"
67
+ "Titel","Title"
68
+ "Quickpay Id","Quickpay Id"
69
+ "MD5 Secret","MD5 Secret"
70
+ "Ny ordre status (Før betaling er gennemført)","New order status (Before the payment is made)"
71
+ "Ny ordre status (Efter betaling er gennemført)","New order status (After the payment is made)"
72
+ "Betaling fra gældende lande","Payment from applicable countries"
73
+ "Betaling fra specifikke lande","Payment from Specific countries"
74
+ "Vælg mulige betalingsmetoder","Select payment options"
75
+ "Vælg specifikke betalingsmetoder","Select specific payment options"
76
+ "Benyt 3D-Secure","Use 3D-Secure"
77
+ "Hvilke logoer skal vises","Which Trusted logos to show"
78
+ "Hvilke kortlogoer skal vises","Which Card logos to show"
79
+ "Øjeblikkelig Hævning","Instant capture"
80
+ "Øjeblikkelig fakturering","Instant invoice"
81
+ "Opret faktura automatisk, hvis hævning sker øjeblikkeligt.","Create the invoice automatically if payment is captured instantly."
82
+ "Send e-mail Ordrebekræftelse. Aktivering af denne indstilling vil resultere i en email-bekræftelse sendes når betalingen er foretaget.","Send Email Order Confirmation. Enabling this setting will result in an email confirmation is send to the cardholder as the payment is made."
83
+ "Håndtering af lager. Varene vil først trækkes fra lageret, når betalingen er gennemført.","Handle stock. The quantity purchased in stock will at first be decremented as the payment is made."
84
+ "OBS! Annullering af ikke betalte ordre, vil give falske lagerantal, med mindre Magento Lagermuligheden 'Sæt produktets status til 'på lager' når en ordre annulleres' er sat til 'Nej'","OBS! if used do not CANCEL unpaid orders unless you have the Magento Stock Option 'Set Items' Status to be In Stock When Order is Cancelled" set to NO"
85
+ "Opkræv Transaktionsgebyr","Charge Transaction fees"
86
+ "Skal også aktiveres hos Quickpay","Must be activated at Quickpay also"
87
+ "Transaktionsgebyr Udspecificeret","Specified Transaction fees"
88
+ "Udspecificeres kun hvis transaktionsgebyr er slået til","Will only be specified if Transaction fees are enabled"
89
+ "Vis gebyrer for","Show Fees for"
90
+ "Vælg hvilke gebyrer der skal vises for kunden","Select the transactionfees you want to show the customer"
91
+ "Bruger","User"
92
+ "Bruger og kode til quickpay er kun nødvendigt, hvis der skal vises gebyrer for kunden. For egen sikkerhed - anbefales det at oprette en bruger helt uden rettigheder i Quickpay Manageren til dette formål","User only required when using Transactionfee's. For own safety - Please create a user to the Quickpay Manager with no permissions"
93
+ "Kode","Password"
94
+ "Sorteringsrækkefølge","Sort order"
package.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Quickpay_Payment_3</name>
4
+ <version>3.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/gpl-3.0.html">GPL-3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>A payment method that allows your customers to pay their orders with creditcards.&#xD;
10
+ The extension even allows you to capture and refund amount directly from your backend as you create your invoices and creditmemo's.</summary>
11
+ <description>A payment method that allows your customers to pay their orders with creditcards.&#xD;
12
+ The extension even allows you to capture and refund amount directly from your backend as you create your invoices and creditmemo's.&#xD;
13
+ &#xD;
14
+ Module-support: support@quickpay.dk</description>
15
+ <notes>Der vil kunne forekomme en konflikt med det gamle quickpay modul. L&#xE6;s eventuelt mere her:&#xD;
16
+ &#xD;
17
+ http://www.tric.dk/quickpay-konflikt-mellem-nyt-og-gammelt-modul</notes>
18
+ <authors><author><name>TRIC Solutions</name><user>TRICsolutions</user><email>info@tric.dk</email></author></authors>
19
+ <date>2012-10-22</date>
20
+ <time>14:35:55</time>
21
+ <contents><target name="magelocal"><dir name="Quickpay"><dir name="Payment"><dir name="Block"><dir name="Info"><file name="Quickpay.php" hash="bf8086399a9a4eb268cfef03b9d8b102"/></dir><dir name="Payment"><file name="Form.php" hash="57ae73c06e89c5a8bd7826ef8954d800"/><file name="Redirect.php" hash="f8fcde73abae46b3375041aaf81b848d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="db7071d2f7d379a2dc6733a013e2cbb1"/></dir><dir name="Model"><dir name="Mysql4"><file name="Setup.php" hash="7c626417c439d250a363307ab05c1a5b"/></dir><file name="Observer.php" hash="3d9ed84e50dda43a32c581a5e1fc9fc4"/><file name="Payment.php" hash="558261aaaf9bd36c669c9220f9145027"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Cardlogos.php" hash="5d36dca2fd10dcbee4825483b51ae762"/><file name="Cardtype.php" hash="6df2bd5a6d86e080b34cf512b0157439"/><file name="Specificcardtypes.php" hash="f78d9ca6f4e4f65574369ef8f4ecf1b3"/><file name="Transactionfees.php" hash="e1f5b943af1236bb19b9ed5ee0a74a1c"/><file name="Trustedlogos.php" hash="bb1e7f710fd6a7f85735903c5d4abbe9"/></dir></dir></dir></dir><dir name="controllers"><file name="PaymentController.php" hash="dab9b2709f1789a1b763b923b8f22a14"/></dir><dir name="etc"><file name="config.xml" hash="773bda0f0a4e7beb5e0538b0f07a3fc2"/><file name="system.xml" hash="1320c45927b10a7542b07898411bf533"/></dir><dir name="sql"><dir name="quickpaypayment_setup"><file name="mysql4-install-1.0.0.php" hash="c4cac587fa7a48f35ca63852fa0eb930"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="da_DK"><file name="Quickpay_Payment.csv" hash="97b6a47d78cb17da74bacfcf2ccc2efc"/></dir><dir name="en_US"><file name="Quickpay_Payment.csv" hash="080b1e9e2f22bdbc165fccc4aa6a5471"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="quickpaypayment"><file name="amex.gif" hash="50aa2133cac08e186f611eacbd81a097"/><file name="cvc_dk.gif" hash="40a1f3952066a97ab03dd2b555367937"/><file name="cvc_master.gif" hash="a392061437749790d0a2b939c12e60f7"/><file name="dankort.gif" hash="50e6e7a27f1e6cb0c7fe5ecea1e46e81"/><file name="danskenetbetaling.gif" hash="fbb227bcb5934a702315e70e40d960be"/><file name="diners.gif" hash="babd91c93f158d697796d610a72a3a6e"/><file name="edankort.gif" hash="7402acb9f45cd4e678ae55a9594905ae"/><file name="euroline.gif" hash="51cf36d26e7979a0dcdda771ab4af668"/><file name="ewire.gif" hash="c48fd8827386a8e4fa7b2bf3871d574c"/><file name="forbrugsforeningen.gif" hash="95e83f2c4e183072de74d26afe798bf1"/><file name="jcb.gif" hash="cc447e5bb30999d78e8b27d6a2a4ce6b"/><file name="maestro.gif" hash="860e9398e9e4d2bdde33c69d31667cfa"/><file name="mastercard.gif" hash="990f13492d1d396e1d55d52a7d1bcb7d"/><file name="mastercard_securecode.gif" hash="61a01902276328287032be2d09f5a650"/><file name="nets.png" hash="af83d2c8da8c729f9c92a9550ba2c907"/><file name="nordea.gif" hash="df741c4d83aee184082ff31430dae915"/><file name="pci.gif" hash="b55a87df550ea6789c17e389604e28e1"/><file name="verisign_secure.gif" hash="88a5e2d4b99d1f8ee396052b275c33cc"/><file name="visa.gif" hash="9c9816d055f87d9bc012bfab87aa866c"/><file name="visa_secure.gif" hash="c9545b81f031a1b67dbe234dcb0f8fbe"/><file name="visaelectron.gif" hash="d107d11f0b4e69a999d2b52dacf95d04"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Quickpay_Payment.xml" hash="84049b2323da450da07ae86228db5be3"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="quickpaypayment"><dir name="info"><file name="info.phtml" hash="de64ade21290cd394a0dc7f0b356a131"/></dir><dir name="payment"><file name="form.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="quickpaypayment"><dir name="info"><file name="default.phtml" hash="8046b094746813af8734535aaa8e6b83"/><file name="payment_info.phtml" hash="8046b094746813af8734535aaa8e6b83"/></dir><dir name="payment"><file name="form (Michael Gregersen's conflicted copy 2012-05-08).phtml" hash="942a72be8e8c5e5165faa503c0fdee89"/><file name="form.phtml" hash="e674d1266f67ff09092bccad8e4a2b7c"/><dir name="info"><file name="payment_info.phtml" hash="2a00670fcb41095a191a264d6df72073"/></dir><dir name="redirect"><file name="paymentwindow.phtml" hash="a3348f592044c13b184890b5eb1709db"/></dir></dir></dir></dir><dir name="layout"><file name="Quickpay_Payment.xml" hash="d8a8d28afe36c831deabf7c0d294c221"/></dir></dir></dir></dir></target></contents>
22
+ <compatible/>
23
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
24
+ </package>
skin/adminhtml/default/default/images/quickpaypayment/amex.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/cvc_dk.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/cvc_master.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/dankort.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/danskenetbetaling.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/diners.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/edankort.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/euroline.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/ewire.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/forbrugsforeningen.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/jcb.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/maestro.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/mastercard.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/mastercard_securecode.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/nets.png ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/nordea.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/pci.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/verisign_secure.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/visa.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/visa_secure.gif ADDED
Binary file
skin/adminhtml/default/default/images/quickpaypayment/visaelectron.gif ADDED
Binary file