diff --git a/info.xml b/info.xml
index 6554c6d..d38e138 100644
--- a/info.xml
+++ b/info.xml
@@ -7,7 +7,7 @@
MonduPayment
100
5.0.0
- 3.0.6
+ 3.0.7
2022-06-07
diff --git a/paymentmethod/MonduPayment.php b/paymentmethod/MonduPayment.php
index 8d46373..200b511 100644
--- a/paymentmethod/MonduPayment.php
+++ b/paymentmethod/MonduPayment.php
@@ -34,6 +34,23 @@ public function isValidIntern($args_arr = []): bool
public function preparePaymentProcess($order): void
{
+ if (
+ isset($order['status']) &&
+ $order['status'] == MonduPayment::STATE_DECLINED ||
+ $order['status'] == MonduPayment::STATE_CANCELED
+ ) {
+ $this->handleFail($order->kBestellung);
+ $upd = new \stdClass();
+ $upd->cStatus = \BESTELLUNG_STATUS_IN_BEARBEITUNG;
+ $upd->cAbgeholt = 'M';
+ Shop::Container()->getDB()->update('tbestellung', 'kBestellung', (int) $order->kBestellung, $upd);
+
+ unset($_SESSION['monduOrderUuid']);
+ unset($_SESSION['monduCartHash']);
+
+ return;
+ }
+
parent::preparePaymentProcess($order);
$this->confirmOrder($order);