Skip to content

Commit

Permalink
Fix cancelling a captured payment
Browse files Browse the repository at this point in the history
refs #84 #83
  • Loading branch information
dopin committed Jul 19, 2023
1 parent a588fff commit 05d4a1d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions includes/class-wc-gateway-komoju-ipn-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,8 @@ protected function payment_status_captured($order, $webhookEvent)
*/
protected function payment_status_cancelled($order, $webhookEvent)
{
$transaction_id = $order->get_transaction_id();
$external_order_num = $webhookEvent->external_order_num();
if (!empty($transaction_id) && $transaction_id != $webhookEvent->external_order_num()) {
WC_Gateway_Komoju::log('Aborting, transaction_id: ' . $transaction_id . ' and external_order_num: ' . $external_order_num . ' do not match.');
if ($order->has_status('captured')) {
WC_Gateway_Komoju::log('Aborting canceling a captured order #' . $order->get_id());
exit;
}

Expand Down

0 comments on commit 05d4a1d

Please sign in to comment.