Version Notes
Bugfixes and performance improvements
Download this release
Release Info
Developer | Komfortkasse |
Extension | Ltc_Komfortkasse |
Version | 1.4.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.4.1 to 1.4.4.2
app/code/community/Ltc/Komfortkasse/Helper/Komfortkasse.php
CHANGED
@@ -8,7 +8,7 @@ require_once 'Komfortkasse_Order.php';
|
|
8 |
*/
|
9 |
class Komfortkasse
|
10 |
{
|
11 |
-
const PLUGIN_VER = '1.4.4.
|
12 |
const MAXLEN_SSL = 117;
|
13 |
const LEN_MCRYPT = 16;
|
14 |
|
@@ -85,7 +85,8 @@ class Komfortkasse
|
|
85 |
$order = Komfortkasse_Order::getRefund($id);
|
86 |
} else {
|
87 |
$order = Komfortkasse_Order::getOrder($id);
|
88 |
-
|
|
|
89 |
}
|
90 |
|
91 |
if (!$order) {
|
@@ -453,35 +454,35 @@ class Komfortkasse
|
|
453 |
*/
|
454 |
protected static function getNewStatus($status, $order)
|
455 |
{
|
456 |
-
$orderType = self::getOrderType($order ['payment_method']);
|
457 |
-
|
458 |
-
switch ($orderType) {
|
459 |
-
case 'PREPAYMENT' :
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
}
|
486 |
|
487 |
// end getNewStatus()
|
8 |
*/
|
9 |
class Komfortkasse
|
10 |
{
|
11 |
+
const PLUGIN_VER = '1.4.4.2';
|
12 |
const MAXLEN_SSL = 117;
|
13 |
const LEN_MCRYPT = 16;
|
14 |
|
85 |
$order = Komfortkasse_Order::getRefund($id);
|
86 |
} else {
|
87 |
$order = Komfortkasse_Order::getOrder($id);
|
88 |
+
if ($order['payment_method'])
|
89 |
+
$order['type'] = self::getOrderType($order['payment_method']);
|
90 |
}
|
91 |
|
92 |
if (!$order) {
|
454 |
*/
|
455 |
protected static function getNewStatus($status, $order)
|
456 |
{
|
457 |
+
$orderType = self::getOrderType($order ['payment_method']);
|
458 |
+
|
459 |
+
switch ($orderType) {
|
460 |
+
case 'PREPAYMENT' :
|
461 |
+
switch ($status) {
|
462 |
+
case 'PAID' :
|
463 |
+
return Komfortkasse_Config::getConfig(Komfortkasse_Config::status_paid, $order);
|
464 |
+
case 'CANCELLED' :
|
465 |
+
return Komfortkasse_Config::getConfig(Komfortkasse_Config::status_cancelled, $order);
|
466 |
+
}
|
467 |
+
return null;
|
468 |
+
case 'INVOICE' :
|
469 |
+
switch ($status) {
|
470 |
+
case 'PAID' :
|
471 |
+
return Komfortkasse_Config::getConfig(Komfortkasse_Config::status_paid_invoice);
|
472 |
+
case 'CANCELLED' :
|
473 |
+
return Komfortkasse_Config::getConfig(Komfortkasse_Config::status_cancelled_invoice);
|
474 |
+
}
|
475 |
+
return null;
|
476 |
+
case 'COD' :
|
477 |
+
switch ($status) {
|
478 |
+
case 'PAID' :
|
479 |
+
return Komfortkasse_Config::getConfig(Komfortkasse_Config::status_paid_cod);
|
480 |
+
case 'CANCELLED' :
|
481 |
+
return Komfortkasse_Config::getConfig(Komfortkasse_Config::status_cancelled_cod);
|
482 |
+
}
|
483 |
+
return null;
|
484 |
+
}
|
485 |
+
|
486 |
}
|
487 |
|
488 |
// end getNewStatus()
|
app/code/community/Ltc/Komfortkasse/Helper/Komfortkasse_Order.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* status: data type according to the shop system
|
9 |
* delivery_ and billing_: _firstname, _lastname, _company, _street, _postcode, _city, _countrycode
|
10 |
* products: an Array of item numbers
|
11 |
-
* @version 1.4.4.
|
12 |
*/
|
13 |
$path = Mage::getModuleDir('', 'Ltc_Komfortkasse');
|
14 |
$order_extension = false;
|
@@ -300,6 +300,7 @@ class Komfortkasse_Order
|
|
300 |
// Hint: PAID and CANCELLED are supported as of now.
|
301 |
$order = Mage::getModel('sales/order')->loadByIncrementId($order ['number']);
|
302 |
|
|
|
303 |
Mage::dispatchEvent('komfortkasse_change_order_status_before', array ('order' => $order,'status' => $status,'callbackid' => $callbackid
|
304 |
));
|
305 |
|
@@ -314,34 +315,46 @@ class Komfortkasse_Order
|
|
314 |
$invoiceColl = $order->getInvoiceCollection();
|
315 |
if ($invoiceColl->getSize() > 0) {
|
316 |
foreach ($order->getInvoiceCollection() as $invoice) {
|
|
|
317 |
$invoice->pay();
|
|
|
318 |
$invoice->addComment($callbackid, false, false);
|
319 |
self::mysave($invoice);
|
320 |
}
|
321 |
} else {
|
322 |
$payment = $order->getPayment();
|
|
|
323 |
$payment->capture(null);
|
324 |
|
325 |
if ($callbackid) {
|
326 |
$payment->setTransactionId($callbackid);
|
|
|
327 |
$transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
328 |
}
|
329 |
}
|
|
|
|
|
330 |
|
|
|
331 |
$history = $order->addStatusHistoryComment('' . $callbackid, $status);
|
|
|
332 |
$order->save();
|
333 |
} else if ($state == 'canceled') {
|
334 |
|
335 |
if ($callbackid) {
|
|
|
336 |
$history = $order->addStatusHistoryComment('' . $callbackid, $status);
|
337 |
}
|
338 |
if ($order->canCancel()) {
|
|
|
339 |
$order->cancel();
|
340 |
}
|
|
|
341 |
$order->setStatus($status);
|
342 |
$order->save();
|
343 |
} else {
|
344 |
|
|
|
345 |
$history = $order->addStatusHistoryComment('' . $callbackid, $status);
|
346 |
$order->save();
|
347 |
}
|
@@ -349,6 +362,8 @@ class Komfortkasse_Order
|
|
349 |
Mage::dispatchEvent('komfortkasse_change_order_status_after', array ('order' => $order,'status' => $status,'callbackid' => $callbackid
|
350 |
));
|
351 |
|
|
|
|
|
352 |
}
|
353 |
|
354 |
// end updateOrder()
|
8 |
* status: data type according to the shop system
|
9 |
* delivery_ and billing_: _firstname, _lastname, _company, _street, _postcode, _city, _countrycode
|
10 |
* products: an Array of item numbers
|
11 |
+
* @version 1.4.4.2-Magento1
|
12 |
*/
|
13 |
$path = Mage::getModuleDir('', 'Ltc_Komfortkasse');
|
14 |
$order_extension = false;
|
300 |
// Hint: PAID and CANCELLED are supported as of now.
|
301 |
$order = Mage::getModel('sales/order')->loadByIncrementId($order ['number']);
|
302 |
|
303 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' START', null, 'komfortkasse.log');
|
304 |
Mage::dispatchEvent('komfortkasse_change_order_status_before', array ('order' => $order,'status' => $status,'callbackid' => $callbackid
|
305 |
));
|
306 |
|
315 |
$invoiceColl = $order->getInvoiceCollection();
|
316 |
if ($invoiceColl->getSize() > 0) {
|
317 |
foreach ($order->getInvoiceCollection() as $invoice) {
|
318 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' invoice ' . $invoice->getIncrementId() . ' pay', null, 'komfortkasse.log');
|
319 |
$invoice->pay();
|
320 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' invoice ' . $invoice->getIncrementId() . ' addComment ' . $callbackid, null, 'komfortkasse.log');
|
321 |
$invoice->addComment($callbackid, false, false);
|
322 |
self::mysave($invoice);
|
323 |
}
|
324 |
} else {
|
325 |
$payment = $order->getPayment();
|
326 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' payment capture', null, 'komfortkasse.log');
|
327 |
$payment->capture(null);
|
328 |
|
329 |
if ($callbackid) {
|
330 |
$payment->setTransactionId($callbackid);
|
331 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' addTransaction', null, 'komfortkasse.log');
|
332 |
$transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
333 |
}
|
334 |
}
|
335 |
+
$order->save();
|
336 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order->getIncrementId());
|
337 |
|
338 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' add status history ' . $status . ' / ' . $callbackid, null, 'komfortkasse.log');
|
339 |
$history = $order->addStatusHistoryComment('' . $callbackid, $status);
|
340 |
+
$order->setStatus($status);
|
341 |
$order->save();
|
342 |
} else if ($state == 'canceled') {
|
343 |
|
344 |
if ($callbackid) {
|
345 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' add status history ' . $status . ' / ' . $callbackid, null, 'komfortkasse.log');
|
346 |
$history = $order->addStatusHistoryComment('' . $callbackid, $status);
|
347 |
}
|
348 |
if ($order->canCancel()) {
|
349 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' cancel', null, 'komfortkasse.log');
|
350 |
$order->cancel();
|
351 |
}
|
352 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' set status ' . $status, null, 'komfortkasse.log');
|
353 |
$order->setStatus($status);
|
354 |
$order->save();
|
355 |
} else {
|
356 |
|
357 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' add status history ' . $status . ' / ' . $callbackid, null, 'komfortkasse.log');
|
358 |
$history = $order->addStatusHistoryComment('' . $callbackid, $status);
|
359 |
$order->save();
|
360 |
}
|
362 |
Mage::dispatchEvent('komfortkasse_change_order_status_after', array ('order' => $order,'status' => $status,'callbackid' => $callbackid
|
363 |
));
|
364 |
|
365 |
+
Mage::log('Komfortkasse: update order ' . $order->getIncrementId() . ' END. Status: ' . $order->getStatus, null, 'komfortkasse.log');
|
366 |
+
|
367 |
}
|
368 |
|
369 |
// end updateOrder()
|
app/code/community/Ltc/Komfortkasse/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Ltc_Komfortkasse>
|
6 |
-
<version>1.4.4.
|
7 |
</Ltc_Komfortkasse>
|
8 |
</modules>
|
9 |
<global>
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Ltc_Komfortkasse>
|
6 |
+
<version>1.4.4.2</version>
|
7 |
</Ltc_Komfortkasse>
|
8 |
</modules>
|
9 |
<global>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ltc_Komfortkasse</name>
|
4 |
-
<version>1.4.4.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://creativecommons.org/licenses/by-nd/4.0/">CC BY-ND 4.0</license>
|
7 |
<channel>community</channel>
|
@@ -15,9 +15,9 @@ Es ist eine Anmeldung auf www.komfortkasse.eu erforderlich (kostenloses Paket ve
|
|
15 |
</description>
|
16 |
<notes>Bugfixes and performance improvements</notes>
|
17 |
<authors><author><name>Komfortkasse</name><user>komfortkasse</user><email>integration@komfortkasse.eu</email></author></authors>
|
18 |
-
<date>2016-
|
19 |
-
<time>
|
20 |
-
<contents><target name="magecommunity"><dir name="Ltc"><dir name="Komfortkasse"><dir name="Helper"><file name="Data.php" hash="ec7f9f8fb6ea400a740ed2c127eb71bc"/><file name="Komfortkasse.php" hash="
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ltc_Komfortkasse</name>
|
4 |
+
<version>1.4.4.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://creativecommons.org/licenses/by-nd/4.0/">CC BY-ND 4.0</license>
|
7 |
<channel>community</channel>
|
15 |
</description>
|
16 |
<notes>Bugfixes and performance improvements</notes>
|
17 |
<authors><author><name>Komfortkasse</name><user>komfortkasse</user><email>integration@komfortkasse.eu</email></author></authors>
|
18 |
+
<date>2016-03-01</date>
|
19 |
+
<time>07:55:56</time>
|
20 |
+
<contents><target name="magecommunity"><dir name="Ltc"><dir name="Komfortkasse"><dir name="Helper"><file name="Data.php" hash="ec7f9f8fb6ea400a740ed2c127eb71bc"/><file name="Komfortkasse.php" hash="94437288becf611e7f4035d1b6318e0c"/><file name="Komfortkasse_Config.php" hash="44cf103f0ddef60890cd6c221262b7e5"/><file name="Komfortkasse_Order.php" hash="03ebf1f7d2e404d94dba9e88941a0d2c"/></dir><dir name="Model"><file name="Observer.php" hash="5b616b6d3651df44f8297c732dc478bb"/></dir><dir name="controllers"><file name="MainController.php" hash="b983fe60b2bbfa3aa1d57850cc6c045b"/></dir><dir name="etc"><file name="config.xml" hash="a86148f8893cf46f0d6e7a77ad616478"/><file name="system.xml" hash="c069f07b4f846e62bc5dd922c81e375b"/></dir></dir></dir><dir name="Mage"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="KomfortkasseEncryptionOptions.php" hash="fea880dd3e60c13ede05be53511a6d93"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ltc_Komfortkasse.xml" hash="433066ef75047d9468dcea87888283d2"/></dir></target></contents>
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|