From c82b9dbeedc6028c56c0946c547892e00ec9fddf Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Thu, 26 Oct 2023 12:12:32 +0200 Subject: [PATCH] Fix wrong gateway name when canceling the order --- src/Payment/PaymentModule.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index 055ada90..6228d62b 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -178,7 +178,7 @@ public function cancelOrderOnExpiryDate() continue; } $heldDurationInSeconds = $heldDuration * 60; - if ($gateway === 'mollie_wc_gateway_bankTransfer') { + if ($gateway === 'Mollie_WC_Gateway_Banktransfer') { $durationInHours = absint($heldDuration) * 24; $durationInMinutes = $durationInHours * 60; $heldDurationInSeconds = $durationInMinutes * 60; @@ -479,6 +479,12 @@ public function cancelOrderAtMollie($order_id) */ public function handleExpiryDateCancelation($paymentMethods) { + add_action( + 'init', + [$this, 'cancelOrderOnExpiryDate'], + 11, + 2 + ); if (!$this->IsExpiryDateEnabled($paymentMethods)) { as_unschedule_action('mollie_woocommerce_cancel_unpaid_orders'); return;