From 2deaf34a69e6f6fd7809303dbe8caae309e11be6 Mon Sep 17 00:00:00 2001 From: Grant Date: Mon, 4 Mar 2024 12:19:04 +0900 Subject: [PATCH] fix cancellation webhook bug --- includes/class-wc-gateway-komoju-ipn-handler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-gateway-komoju-ipn-handler.php b/includes/class-wc-gateway-komoju-ipn-handler.php index 592ba23..054df6d 100644 --- a/includes/class-wc-gateway-komoju-ipn-handler.php +++ b/includes/class-wc-gateway-komoju-ipn-handler.php @@ -236,7 +236,7 @@ protected function payment_status_captured($order, $webhookEvent) */ protected function payment_status_cancelled($order, $webhookEvent) { - if (!$this->is_order_cancellable($order)) { + if (!$this->is_order_cancellable($order, $webhookEvent)) { $transaction_id = $order->get_transaction_id(); $external_order_num = $webhookEvent->external_order_num(); WC_Gateway_Komoju::log('Aborting, transaction_id: ' . $transaction_id . ' and external_order_num: ' . $external_order_num . ' do not match.'); @@ -251,7 +251,7 @@ protected function payment_status_cancelled($order, $webhookEvent) * * @return bool return true if the order is cancellable */ - protected function is_order_cancellable($order) + protected function is_order_cancellable($order, $webhookEvent) { $transaction_id = $order->get_transaction_id(); if (empty($transaction_id)) {