Skip to content

Commit

Permalink
Fix wrong gateway name when canceling the order
Browse files Browse the repository at this point in the history
  • Loading branch information
inpsyde-maticluznar committed Oct 26, 2023
1 parent 0e82e62 commit c82b9db
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Payment/PaymentModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c82b9db

Please sign in to comment.